Update WeaponAction.cs

This commit is contained in:
Dawid Bepierszcz
2024-02-10 15:34:34 +01:00
parent 4087d3d016
commit 558f3178f2

View File

@@ -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)
return;
@@ -358,7 +358,10 @@ namespace WeaponPaints
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));
break;
}