Fix no lobby, no job spawn (#6265)

This commit is contained in:
wrexbe
2022-01-23 09:44:27 -08:00
committed by GitHub
parent af1aa7ec77
commit 6a0a0cffd1

View File

@@ -91,9 +91,13 @@ namespace Content.Server.GameTicking
// Pick best job best on prefs.
jobId ??= PickBestAvailableJob(character, station);
// If no job available, just bail out.
// If no job available, stay in lobby, or if no lobby spawn as observer
if (jobId is null)
{
if (!LobbyEnabled)
{
MakeObserve(player);
}
_chatManager.DispatchServerMessage(player, Loc.GetString("game-ticker-player-no-jobs-available-when-joining"));
return;
}
@@ -183,8 +187,6 @@ namespace Content.Server.GameTicking
if (DummyTicker)
return;
if (!_playersInLobby.ContainsKey(player)) return;
PlayerJoinGame(player);
var name = GetPlayerProfile(player).Name;