Fix crash that apparently exists

This commit is contained in:
LightCat 2019-01-14 17:11:22 +01:00
parent 44f5206e38
commit 471b0861cd

View File

@ -614,6 +614,8 @@ bool HasWeapon(CachedEntity *ent, int wantedId)
int *hWeapons; int *hWeapons;
// Grab the handle and store it into the var // Grab the handle and store it into the var
hWeapons = (int *) ((unsigned) (RAW_ENT(ent) + netvar.hMyWeapons)); hWeapons = (int *) ((unsigned) (RAW_ENT(ent) + netvar.hMyWeapons));
if (!hWeapons || !RAW_ENT(ent) || ent->m_Type() != ENTITY_PLAYER)
return false;
// Go through the handle array and search for the item // Go through the handle array and search for the item
for (int i = 0; hWeapons[i]; i++) for (int i = 0; hWeapons[i]; i++)
{ {