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
							
								
									4dc220bda3
								
							
						
					
					
						commit
						83bab0be00
					
				@ -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;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user