Fix crash on game load from missing local player

This commit is contained in:
NGnius (Graham) 2020-06-02 17:06:58 -04:00
parent 6990ae2835
commit caf714a3d9

View file

@ -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<FilteredChannelDataStruct>(CommonExclusiveGroups.OWNED_BLOCKS_GROUP).ToFastAccess(out uint count);
for (uint i = 0; i < count; i++)
{