mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-03-10 00:22:30 +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);
|
var weapon = new CBasePlayerWeapon(entity.Handle);
|
||||||
Server.NextFrame(() =>
|
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));
|
var pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex((int)weapon.OwnerEntity.Value.EntityIndex!.Value.Value));
|
||||||
if (!pawn.IsValid) return;
|
if (!pawn.IsValid) return;
|
||||||
var playerIndex = (int)pawn.Controller.Value.EntityIndex!.Value.Value;
|
var playerIndex = (int)pawn.Controller.Value.EntityIndex!.Value.Value;
|
||||||
@@ -114,8 +114,7 @@ public class WeaponPaints : BasePlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_playersSkins[steamId.SteamId64][weaponId] = weaponPaint;
|
g_playersSkins[steamId.SteamId64][weaponId] = weaponPaint;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user