From: havoc Date: Sat, 24 Feb 2007 10:05:38 +0000 (+0000) Subject: allow 0 parameters in VM_SV_makestatic due to a bug in id1 qc X-Git-Tag: xonotic-v0.1.0preview~3498 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f4be0db0317f362626f52d8dafff527fc6856092;p=xonotic%2Fdarkplaces.git allow 0 parameters in VM_SV_makestatic due to a bug in id1 qc git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6918 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/svvm_cmds.c b/svvm_cmds.c index 9be2ed71..0062dcfd 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -1192,9 +1192,14 @@ static void VM_SV_makestatic (void) prvm_edict_t *ent; int i, large; - VM_SAFEPARMCOUNT(1, VM_SV_makestatic); + // allow 0 parameters due to an id1 qc bug in which this function is used + // with no parameters (but directly after setmodel with self in OFS_PARM0) + VM_SAFEPARMCOUNTRANGE(0, 1, VM_SV_makestatic); - ent = PRVM_G_EDICT(OFS_PARM0); + if (prog->argc >= 1) + ent = PRVM_G_EDICT(OFS_PARM0); + else + ent = PRVM_PROG_TO_EDICT(prog->globals.server->self); if (ent == prog->edicts) { VM_Warning("makestatic: can not modify world entity\n");