diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index df4c44a6..31bead88 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -223,7 +223,7 @@ public void OnEntitySpawned(int entity) if (config.iWeaponID && config.iWeaponID == iHammerID) { - if (!RegisterExistingItem(entity, REGISTER_WEAPON)) + if (!RegisterExistingItem(config, entity, REGISTER_WEAPON)) { CItem item = new CItem(config); @@ -233,7 +233,7 @@ public void OnEntitySpawned(int entity) } else if (config.iButtonID && config.iButtonID == iHammerID) { - if (!RegisterExistingItem(entity, REGISTER_BUTTON)) + if (!RegisterExistingItem(config, entity, REGISTER_BUTTON)) { CItem item = new CItem(config); @@ -243,7 +243,7 @@ public void OnEntitySpawned(int entity) } else if (config.iTriggerID && config.iTriggerID == iHammerID) { - if (!RegisterExistingItem(entity, REGISTER_TRIGGER)) + if (!RegisterExistingItem(config, entity, REGISTER_TRIGGER)) { CItem item = new CItem(config); @@ -258,7 +258,7 @@ public void OnEntitySpawned(int entity) //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -stock bool RegisterExistingItem(int entity, int type) +stock bool RegisterExistingItem(CConfig config, int entity, int type) { if (Entity_IsValid(entity) && g_hArray_Items.Length) { @@ -266,8 +266,11 @@ stock bool RegisterExistingItem(int entity, int type) { CItem item = g_hArray_Items.Get(index); - if (RegisterItemEntity(item, entity, type)) - return true; + if (item.dConfig == config) + { + if (RegisterItemEntity(item, entity, type)) + return true; + } } }