Skip to content
This repository was archived by the owner on Jan 25, 2025. It is now read-only.

Commit d8c74a4

Browse files
committed
hotfix: Threading problems
1 parent e872fa8 commit d8c74a4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

K4-System/src/Plugin/PluginDatabase.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,14 @@ public async Task LoadAllPlayersCacheAsync(string combinedQuery)
466466
string steamId = row.steam_id;
467467
K4Player? k4player = K4Players.FirstOrDefault(p => p.SteamID == ulong.Parse(steamId));
468468

469-
if (k4player != null && k4player.IsValid && k4player.IsPlayer)
469+
if (k4player is null)
470+
continue;
471+
472+
Server.NextFrame(() =>
470473
{
471-
LoadPlayerRowToCache(k4player, row, true);
472-
}
474+
if (k4player.IsValid && k4player.IsPlayer)
475+
LoadPlayerRowToCache(k4player, row, true);
476+
});
473477
}
474478
}
475479
}

0 commit comments

Comments
 (0)