entWatch4: Remove some 'useless' code.

This commit is contained in:
zaCade 2019-03-27 16:32:39 +01:00
parent 1e9287a125
commit 137ef3d4b1

View File

@ -221,8 +221,7 @@ public void OnEntitySpawned(int entity)
if (config.iWeaponID && config.iWeaponID == Entity_GetHammerId(entity)) if (config.iWeaponID && config.iWeaponID == Entity_GetHammerId(entity))
{ {
bool bExisting = RegisterExistingItem(entity, REGISTERTYPE_WEAPON); if (!RegisterExistingItem(entity, REGISTERTYPE_WEAPON))
if (!bExisting)
{ {
CItem item = new CItem(config); CItem item = new CItem(config);
@ -232,8 +231,7 @@ public void OnEntitySpawned(int entity)
} }
else if (config.iButtonID && config.iButtonID == Entity_GetHammerId(entity)) else if (config.iButtonID && config.iButtonID == Entity_GetHammerId(entity))
{ {
bool bExisting = RegisterExistingItem(entity, REGISTERTYPE_BUTTON); if (!RegisterExistingItem(entity, REGISTERTYPE_BUTTON))
if (!bExisting)
{ {
CItem item = new CItem(config); CItem item = new CItem(config);
@ -243,8 +241,7 @@ public void OnEntitySpawned(int entity)
} }
else if (config.iTriggerID && config.iTriggerID == Entity_GetHammerId(entity)) else if (config.iTriggerID && config.iTriggerID == Entity_GetHammerId(entity))
{ {
bool bExisting = RegisterExistingItem(entity, REGISTERTYPE_TRIGGER); if (!RegisterExistingItem(entity, REGISTERTYPE_TRIGGER))
if (!bExisting)
{ {
CItem item = new CItem(config); CItem item = new CItem(config);
@ -317,12 +314,6 @@ stock bool RegisterItemEntity(CItem item, int entity, int type)
return true; 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(client);
Call_PushCell(index); Call_PushCell(index);
Call_Finish(); Call_Finish();
return Plugin_Continue;
}
default:
{
return Plugin_Handled;
} }
} }
return aResult;
} }
} }
} }