mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 02:41:54 +00:00
2.2e
- Changed data loading to non-block main thread - Additional check for empty agent
This commit is contained in:
@@ -300,14 +300,17 @@ namespace WeaponPaints
|
||||
{
|
||||
if (!g_playersAgent.ContainsKey(player.Slot)) return;
|
||||
|
||||
string? model = player.TeamNum == 3 ? g_playersAgent[player.Slot].CT : g_playersAgent[player.Slot].T;
|
||||
if (string.IsNullOrEmpty(model)) return;
|
||||
|
||||
if (player.PlayerPawn.Value == null)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
string? model = player.TeamNum == 3 ? g_playersAgent[player.Slot].CT : g_playersAgent[player.Slot].T;
|
||||
if (string.IsNullOrEmpty(model)) return;
|
||||
|
||||
player.PlayerPawn.Value!.SetModel(
|
||||
player.PlayerPawn.Value.SetModel(
|
||||
$"characters/models/{model}.vmdl"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user