WeaponCleaner: fix server crash
This commit is contained in:
		
							parent
							
								
									3d24fb83e0
								
							
						
					
					
						commit
						51ae6cec1a
					
				@ -191,7 +191,8 @@ public Action OnWeaponDrop(int client, int entity)
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Kill all dropped weapons during mp_freezetime
 | 
						// Kill all dropped weapons during mp_freezetime
 | 
				
			||||||
	if(GetTime() < g_RealRoundStartedTime)
 | 
						// or if no weapons are allowed at all
 | 
				
			||||||
 | 
						if(GetTime() < g_RealRoundStartedTime || !g_MaxWeapons)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		// Kill it
 | 
							// Kill it
 | 
				
			||||||
		AcceptEntityInput(entity, "Kill");
 | 
							AcceptEntityInput(entity, "Kill");
 | 
				
			||||||
@ -204,6 +205,9 @@ public Action OnWeaponDrop(int client, int entity)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool InsertWeapon(int entity)
 | 
					bool InsertWeapon(int entity)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if(!g_MaxWeapons)
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int entref = EntIndexToEntRef(entity);
 | 
						int entref = EntIndexToEntRef(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Try to find a free slot
 | 
						// Try to find a free slot
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user