From f4be0db0317f362626f52d8dafff527fc6856092 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 24 Feb 2007 10:05:38 +0000 Subject: [PATCH] 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 --- svvm_cmds.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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"); -- 2.39.2