From caf714a3d964f81105af0d70855b26d7fb0033b0 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 2 Jun 2020 17:06:58 -0400 Subject: [PATCH] Fix crash on game load from missing local player --- Leadercraft/Scoring/GameLoop.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Leadercraft/Scoring/GameLoop.cs b/Leadercraft/Scoring/GameLoop.cs index 3b506c1..4a47ba4 100644 --- a/Leadercraft/Scoring/GameLoop.cs +++ b/Leadercraft/Scoring/GameLoop.cs @@ -33,8 +33,8 @@ namespace Leadercraft.Scoring private static void loopPass(EntitiesDB entitiesDB) { - if (localPlayer == null) localPlayer = new Player(PlayerType.Local); if (!State.IsPlayingGame) return; + if (localPlayer == null && Player.Exists(PlayerType.Local)) localPlayer = new Player(PlayerType.Local); FilteredChannelDataStruct[] channelInfo = entitiesDB.QueryEntities(CommonExclusiveGroups.OWNED_BLOCKS_GROUP).ToFastAccess(out uint count); for (uint i = 0; i < count; i++) {