mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 18:49:21 +00:00
should fix crash #6
This commit is contained in:
@@ -46,7 +46,7 @@ public class WeaponPaints : BasePlugin
|
||||
var weapon = new CBasePlayerWeapon(entity.Handle);
|
||||
Server.NextFrame(() =>
|
||||
{
|
||||
if (!weapon.IsValid) return;
|
||||
if (!weapon.IsValid || !weapon.OwnerEntity.IsValid) return;
|
||||
var pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex((int)weapon.OwnerEntity.Value.EntityIndex!.Value.Value));
|
||||
if (!pawn.IsValid) return;
|
||||
var playerIndex = (int)pawn.Controller.Value.EntityIndex!.Value.Value;
|
||||
@@ -114,8 +114,7 @@ public class WeaponPaints : BasePlugin
|
||||
}
|
||||
|
||||
g_playersSkins[steamId.SteamId64][weaponId] = weaponPaint;
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user