]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - svvm_cmds.c
implemented .loc file support, including some editing (add command, and removenearest...
[xonotic/darkplaces.git] / svvm_cmds.c
index 9be2ed7177462246757d76794166ff3ea82b7f9e..b7d20b7f7061b46ed7adb98436e8332f463d4d24 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");
@@ -1248,7 +1253,7 @@ static void VM_SV_setspawnparms (void)
        int             i;
        client_t        *client;
 
-       VM_SAFEPARMCOUNT(0, VM_SV_setspawnparms);
+       VM_SAFEPARMCOUNT(1, VM_SV_setspawnparms);
 
        ent = PRVM_G_EDICT(OFS_PARM0);
        i = PRVM_NUM_FOR_EDICT(ent);