Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
hotfix: Threading problems
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed May 18, 2024
1 parent e872fa8 commit d8c74a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions K4-System/src/Plugin/PluginDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,14 @@ public async Task LoadAllPlayersCacheAsync(string combinedQuery)
string steamId = row.steam_id;
K4Player? k4player = K4Players.FirstOrDefault(p => p.SteamID == ulong.Parse(steamId));

if (k4player != null && k4player.IsValid && k4player.IsPlayer)
if (k4player is null)
continue;

Server.NextFrame(() =>
{
LoadPlayerRowToCache(k4player, row, true);
}
if (k4player.IsValid && k4player.IsPlayer)
LoadPlayerRowToCache(k4player, row, true);
});
}
}
}
Expand Down

0 comments on commit d8c74a4

Please sign in to comment.