diff --git a/WeaponAction.cs b/WeaponAction.cs index 40937a1a..f16dede0 100644 --- a/WeaponAction.cs +++ b/WeaponAction.cs @@ -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; }