- fixed submarine selection resetting when switching to netlobbyscreen

- fixed EntityGrid IndexOutOfRangeException
- fixed AssignJobs() ignoring the highest job preference
This commit is contained in:
Regalis
2016-06-07 16:57:58 +03:00
parent 9689ef070d
commit 8f8f1ed7dc
3 changed files with 11 additions and 6 deletions

View File

@@ -1725,8 +1725,9 @@ namespace Barotrauma.Networking
Client preferredClient = null;
foreach (Client c in clients)
{
int index = c.jobPreferences.FindIndex(jp => jp == job);
if (index == 0) index = 1000;
int index = c.jobPreferences.IndexOf(job);
if (index == -1) index = 1000;
if (preferredClient == null || index < bestPreference)
{
bestPreference = index;