From b6c2dc6e1e7a008e71505a422fd9f89d948697b7 Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 27 Mar 2019 16:32:39 +0100 Subject: [PATCH] entWatch4: Remove some 'useless' code. --- _entWatch4/scripting/entWatch-core.sp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index 8b80d439..fbc15771 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -221,8 +221,7 @@ public void OnEntitySpawned(int entity) if (config.iWeaponID && config.iWeaponID == Entity_GetHammerId(entity)) { - bool bExisting = RegisterExistingItem(entity, REGISTERTYPE_WEAPON); - if (!bExisting) + if (!RegisterExistingItem(entity, REGISTERTYPE_WEAPON)) { CItem item = new CItem(config); @@ -232,8 +231,7 @@ public void OnEntitySpawned(int entity) } else if (config.iButtonID && config.iButtonID == Entity_GetHammerId(entity)) { - bool bExisting = RegisterExistingItem(entity, REGISTERTYPE_BUTTON); - if (!bExisting) + if (!RegisterExistingItem(entity, REGISTERTYPE_BUTTON)) { CItem item = new CItem(config); @@ -243,8 +241,7 @@ public void OnEntitySpawned(int entity) } else if (config.iTriggerID && config.iTriggerID == Entity_GetHammerId(entity)) { - bool bExisting = RegisterExistingItem(entity, REGISTERTYPE_TRIGGER); - if (!bExisting) + if (!RegisterExistingItem(entity, REGISTERTYPE_TRIGGER)) { CItem item = new CItem(config); @@ -317,12 +314,6 @@ stock bool RegisterItemEntity(CItem item, int entity, int type) return true; } } - default: - { - LogError("Attempted to register item with invalid type: %d! This should never happen.", type); - - return false; - } } } @@ -557,14 +548,10 @@ public Action OnButtonPress(int button, int client) Call_PushCell(client); Call_PushCell(index); Call_Finish(); - - return Plugin_Continue; - } - default: - { - return Plugin_Handled; } } + + return aResult; } } }