mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
allow NUM_FOR_EDICT to work with a null edict no matter what (hopefully not a
bad thing)
This commit is contained in:
parent
867260d27d
commit
37661f3cce
1 changed files with 2 additions and 2 deletions
|
@ -1304,8 +1304,8 @@ NUM_FOR_EDICT (progs_t * pr, edict_t *e)
|
||||||
b = (byte *) e - (byte *) * (pr)->edicts;
|
b = (byte *) e - (byte *) * (pr)->edicts;
|
||||||
b = b / pr->pr_edict_size;
|
b = b / pr->pr_edict_size;
|
||||||
|
|
||||||
if (b < 0 || b >= *(pr)->num_edicts)
|
if (b && (b < 0 || b >= *(pr)->num_edicts))
|
||||||
PR_Error (pr, "NUM_FOR_EDICT: bad pointer");
|
PR_Error (pr, "NUM_FOR_EDICT: bad pointer %d %p %p", b, e, * (pr)->edicts);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue