entWatch4: Whoop Die Doo, Fix Item Registering.
No longer will items get registered as if they are another one, hopefully ;-;
This commit is contained in:
parent
ecbf18e14f
commit
51f5588f3d
@ -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,10 +266,13 @@ stock bool RegisterExistingItem(int entity, int type)
|
||||
{
|
||||
CItem item = g_hArray_Items.Get(index);
|
||||
|
||||
if (item.dConfig == config)
|
||||
{
|
||||
if (RegisterItemEntity(item, entity, type))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user