- fixed submarine selection resetting when switching to netlobbyscreen
- fixed EntityGrid IndexOutOfRangeException - fixed AssignJobs() ignoring the highest job preference
This commit is contained in:
@@ -40,9 +40,9 @@ namespace Barotrauma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int x = Math.Max(indices.X, 0); x <= Math.Min(indices.Width, entities.GetLength(0)); x++)
|
for (int x = Math.Max(indices.X, 0); x <= Math.Min(indices.Width, entities.GetLength(0)-1); x++)
|
||||||
{
|
{
|
||||||
for (int y = Math.Max(indices.Y,0); y <= Math.Min(indices.Height, entities.GetLength(1)); y++)
|
for (int y = Math.Max(indices.Y,0); y <= Math.Min(indices.Height, entities.GetLength(1)-1); y++)
|
||||||
{
|
{
|
||||||
entities[x, y].Add(entity);
|
entities[x, y].Add(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1725,8 +1725,9 @@ namespace Barotrauma.Networking
|
|||||||
Client preferredClient = null;
|
Client preferredClient = null;
|
||||||
foreach (Client c in clients)
|
foreach (Client c in clients)
|
||||||
{
|
{
|
||||||
int index = c.jobPreferences.FindIndex(jp => jp == job);
|
int index = c.jobPreferences.IndexOf(job);
|
||||||
if (index == 0) index = 1000;
|
if (index == -1) index = 1000;
|
||||||
|
|
||||||
if (preferredClient == null || index < bestPreference)
|
if (preferredClient == null || index < bestPreference)
|
||||||
{
|
{
|
||||||
bestPreference = index;
|
bestPreference = index;
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (IsServer && GameMain.Server != null)
|
if (IsServer && GameMain.Server != null)
|
||||||
{
|
{
|
||||||
|
int prevSelected = subList.SelectedIndex;
|
||||||
UpdateSubList(Submarine.SavedSubmarines);
|
UpdateSubList(Submarine.SavedSubmarines);
|
||||||
|
|
||||||
modeList.OnSelected = VotableClicked;
|
modeList.OnSelected = VotableClicked;
|
||||||
@@ -378,7 +379,10 @@ namespace Barotrauma
|
|||||||
banListButton.OnClicked = GameMain.Server.BanList.ToggleBanFrame;
|
banListButton.OnClicked = GameMain.Server.BanList.ToggleBanFrame;
|
||||||
banListButton.UserData = "banListButton";
|
banListButton.UserData = "banListButton";
|
||||||
|
|
||||||
if (subList.CountChildren > 0 && subList.Selected == null) subList.Select(0);
|
if (subList.CountChildren > 0 && subList.Selected == null)
|
||||||
|
{
|
||||||
|
subList.Select(Math.Max(0, prevSelected));
|
||||||
|
}
|
||||||
if (GameModePreset.list.Count > 0 && modeList.Selected == null) modeList.Select(0);
|
if (GameModePreset.list.Count > 0 && modeList.Selected == null) modeList.Select(0);
|
||||||
|
|
||||||
if (myPlayerFrame.children.Find(c => c.UserData as string == "playyourself") == null)
|
if (myPlayerFrame.children.Find(c => c.UserData as string == "playyourself") == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user