mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +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 = b / pr->pr_edict_size;
|
||||
|
||||
if (b < 0 || b >= *(pr)->num_edicts)
|
||||
PR_Error (pr, "NUM_FOR_EDICT: bad pointer");
|
||||
if (b && (b < 0 || b >= *(pr)->num_edicts))
|
||||
PR_Error (pr, "NUM_FOR_EDICT: bad pointer %d %p %p", b, e, * (pr)->edicts);
|
||||
return b;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue