WeaponCleaner: fix server crash

This commit is contained in:
BotoX 2018-03-21 21:49:19 +01:00
parent 3d24fb83e0
commit 51ae6cec1a

View File

@ -191,7 +191,8 @@ public Action OnWeaponDrop(int client, int entity)
return;
// 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
AcceptEntityInput(entity, "Kill");
@ -204,6 +205,9 @@ public Action OnWeaponDrop(int client, int entity)
bool InsertWeapon(int entity)
{
if(!g_MaxWeapons)
return false;
int entref = EntIndexToEntRef(entity);
// Try to find a free slot