]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
allow 0 parameters in VM_SV_makestatic due to a bug in id1 qc
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 24 Feb 2007 10:05:38 +0000 (10:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 24 Feb 2007 10:05:38 +0000 (10:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6918 d7cf8633-e32d-0410-b094-e92efae38249

svvm_cmds.c

index 9be2ed7177462246757d76794166ff3ea82b7f9e..0062dcfd9f99688ea07932236433a664e54d26f4 100644 (file)
@@ -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");