Add or adjust a bunch of safety checks (#433)

This commit is contained in:
Vincent Herbet
2018-08-26 17:18:39 +02:00
committed by GitHub
parent 8aeefc3fca
commit 9bcabfeb1f
14 changed files with 156 additions and 86 deletions

View File

@ -1434,8 +1434,15 @@ int C_Cmd_Argc(void)
// Only here we may find out who is an owner.
void C_SetModel(edict_t *e, const char *m)
{
if (e->v.owner && m[7]=='w' && m[8]=='_' && m[9]=='h')
g_grenades.put(e, 1.75, 4, GET_PLAYER_POINTER(e->v.owner));
if (!m || strcmp(m, "models/w_hegrenade.mdl") != 0)
{
RETURN_META(MRES_IGNORED);
}
if (e->v.owner)
{
g_grenades.put(e, 1.75f, 4, GET_PLAYER_POINTER(e->v.owner));
}
RETURN_META(MRES_IGNORED);
}