Fix crash that apparently exists
This commit is contained in:
parent
44f5206e38
commit
471b0861cd
@ -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++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user