From 6ac450a8006f8baa9c271ce8ccb1353b0310a630 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 29 Jan 2011 08:32:32 +0000 Subject: [PATCH] fix a crash on edict_num(32767) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10777 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2