mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-03-07 23:37:55 +00:00
Update WeaponAction.cs
This commit is contained in:
@@ -337,7 +337,7 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void RefreshKnife(CCSPlayerController? player, bool force = false)
|
internal void RefreshKnife(CCSPlayerController? player)
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid || player.PlayerPawn?.Value == null || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE)
|
if (player == null || !player.IsValid || player.PlayerPawn?.Value == null || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE)
|
||||||
return;
|
return;
|
||||||
@@ -358,7 +358,10 @@ namespace WeaponPaints
|
|||||||
|
|
||||||
if (weapon.Value.DesignerName.Contains("knife") || weaponData?.GearSlot == gear_slot_t.GEAR_SLOT_KNIFE)
|
if (weapon.Value.DesignerName.Contains("knife") || weaponData?.GearSlot == gear_slot_t.GEAR_SLOT_KNIFE)
|
||||||
{
|
{
|
||||||
player.RemoveItemByDesignerName(weapon.Value.DesignerName, weapon.Value.Entity?.EntityInstance.IsValid ?? false);
|
player.RemoveItemByDesignerName(weapon.Value.DesignerName, false);
|
||||||
|
if (weapon.Value.Entity != null && weapon.Value.Entity.EntityInstance.IsValid)
|
||||||
|
weapon.Value.Remove();
|
||||||
|
|
||||||
AddTimer(0.2f, () => GiveKnifeToPlayer(player));
|
AddTimer(0.2f, () => GiveKnifeToPlayer(player));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user