From 86c2d688a65fcd523f4ff25da7d94a672571c774 Mon Sep 17 00:00:00 2001 From: BotoX Date: Mon, 19 Dec 2016 09:29:54 +0100 Subject: [PATCH] SDKUnhook apparently causes lag and RemoveEdict is evil --- WeaponCleaner/scripting/WeaponCleaner.sp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/WeaponCleaner/scripting/WeaponCleaner.sp b/WeaponCleaner/scripting/WeaponCleaner.sp index 85cfe2d..5704d6d 100644 --- a/WeaponCleaner/scripting/WeaponCleaner.sp +++ b/WeaponCleaner/scripting/WeaponCleaner.sp @@ -24,7 +24,7 @@ public Plugin myinfo = name = "WeaponCleaner", author = "BotoX", description = "Clean unneeded weapons", - version = "2.2", + version = "2.2.1", url = "" }; @@ -134,7 +134,7 @@ public void OnEntityDestroyed(int entity) public void OnWeaponSpawned(int entity) { - SDKUnhook(entity, SDKHook_Spawn, OnWeaponSpawned); + //SDKUnhook(entity, SDKHook_Spawn, OnWeaponSpawned); int HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID"); // Should not be cleaned since it's a map spawned weapon @@ -259,14 +259,9 @@ bool KillWeapon(int entref) if(!IsValidEntity(entref)) return RemoveWeapon(entref); - // This implicitly calls OnEntityDestroyed() on success which calls RemoveWeapon() AcceptEntityInput(entref, "Kill"); - // Not successful? - if(IsValidEntity(entref)) - return RemoveWeapon(entref); - - return true; + return RemoveWeapon(entref); } public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)