Fixed exceptions in NetLobbyScreen.UpdatePlayerFrame if job preferences contain jobs that aren't in the list of job prefabs
This commit is contained in:
@@ -542,8 +542,11 @@ namespace Barotrauma
|
|||||||
int i = 1;
|
int i = 1;
|
||||||
foreach (string jobName in GameMain.Config.JobNamePreferences)
|
foreach (string jobName in GameMain.Config.JobNamePreferences)
|
||||||
{
|
{
|
||||||
JobPrefab job = JobPrefab.List.First(x => x.Name == jobName);
|
JobPrefab job = JobPrefab.List.Find(x => x.Name == jobName);
|
||||||
if (job == null) { continue; }
|
if (job == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name + " ",
|
GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name + " ",
|
||||||
"", Alignment.Left, Alignment.Right, jobList, false,
|
"", Alignment.Left, Alignment.Right, jobList, false,
|
||||||
|
|||||||
Reference in New Issue
Block a user