From: divverent Date: Sat, 29 Jan 2011 08:32:32 +0000 (+0000) Subject: fix a crash on edict_num(32767) X-Git-Tag: xonotic-v0.5.0~438^2~64 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6ac450a8006f8baa9c271ce8ccb1353b0310a630;p=xonotic%2Fdarkplaces.git fix a crash on edict_num(32767) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10777 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_cmds.c b/prvm_cmds.c index afe34225..01386fd8 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -874,7 +874,7 @@ void VM_ftoe(void) VM_SAFEPARMCOUNT(1, VM_ftoe); ent = (int)PRVM_G_FLOAT(OFS_PARM0); - if (ent < 0 || ent >= MAX_EDICTS || PRVM_PROG_TO_EDICT(ent)->priv.required->free) + if (ent < 0 || ent >= prog->max_edicts || PRVM_PROG_TO_EDICT(ent)->priv.required->free) ent = 0; // return world instead of a free or invalid entity PRVM_G_INT(OFS_RETURN) = ent;