Fix the job overflow crash (#5560)
* Fix the overflow crash * localization fail
This commit is contained in:
@@ -81,6 +81,15 @@ namespace Content.Server.GameTicking
|
||||
return;
|
||||
}
|
||||
|
||||
// Pick best job best on prefs.
|
||||
jobId ??= PickBestAvailableJob(character, station);
|
||||
// If no job available, just bail out.
|
||||
if (jobId is null)
|
||||
{
|
||||
_chatManager.DispatchServerMessage(player, Loc.GetString("game-ticker-player-no-jobs-available-when-joining"));
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerJoinGame(player);
|
||||
|
||||
var data = player.ContentData();
|
||||
@@ -94,9 +103,6 @@ namespace Content.Server.GameTicking
|
||||
};
|
||||
newMind.ChangeOwningPlayer(data.UserId);
|
||||
|
||||
// Pick best job best on prefs.
|
||||
jobId ??= PickBestAvailableJob(character, station);
|
||||
|
||||
var jobPrototype = _prototypeManager.Index<JobPrototype>(jobId);
|
||||
var job = new Job(newMind, jobPrototype);
|
||||
newMind.AddRole(job);
|
||||
|
||||
Reference in New Issue
Block a user