X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=svvm_cmds.c;h=b0283c952fe621e438562437cf7c474d6d463e65;hb=b3f5f964484b851ef9eb6b714780210693462b4c;hp=2a1cb181202513f220275fcabe2843744d296a59;hpb=2382d45cfcebcc458f8889eb1477a5d9a8716939;p=xonotic%2Fdarkplaces.git diff --git a/svvm_cmds.c b/svvm_cmds.c index 2a1cb181..b0283c95 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -3,7 +3,7 @@ //============================================================================ // Server -cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"}; //"0.93"}; // LordHavoc: disabled autoaim by default +cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"}; char *vm_sv_extensions = @@ -963,7 +963,7 @@ VM_SV_checkbottom */ static void VM_SV_checkbottom (void) { - VM_SAFEPARMCOUNT(0, VM_SV_checkbottom); + VM_SAFEPARMCOUNT(1, VM_SV_checkbottom); PRVM_G_FLOAT(OFS_RETURN) = SV_CheckBottom (PRVM_G_EDICT(OFS_PARM0)); } @@ -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);