]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a crash on edict_num(32767)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 29 Jan 2011 08:32:32 +0000 (08:32 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 29 Jan 2011 08:32:32 +0000 (08:32 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10777 d7cf8633-e32d-0410-b094-e92efae38249

prvm_cmds.c

index afe34225aa4af6db2cd08c31f22227b42cd7e8c7..01386fd8852bf6a4cb7593980a2f0d68e71cf183 100644 (file)
@@ -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;