]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Rename sv_gameplayfix_customstats to sv_qcstats, improve description
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 23 Nov 2023 19:45:12 +0000 (05:45 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 9 Dec 2023 10:13:33 +0000 (20:13 +1000)
It's an API change not a gameplay change.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cmd.c
sv_main.c
sv_send.c
svvm_cmds.c

diff --git a/cmd.c b/cmd.c
index 6230fa021854d31fd72fb6535b664e3ddd196446..66dfaa820001f788ffae651febc678bc23499e9b 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -764,7 +764,7 @@ static void Cmd_Exec(cmd_state_t *cmd, const char *filename)
                        Cbuf_InsertText(cmd, "\n"
 "csqc_polygons_defaultmaterial_nocullface 1\n"
 "con_chatsound_team_mask 13\n"
-"sv_gameplayfix_customstats 1\n"
+"sv_qcstats 1\n"
 "mod_q1bsp_zero_hullsize_cutoff 8.03125\n"
                                );
                        break;
index 4f6c2426f72275c75f157c14b8892bd3fd82c973..f656085c67ca1d8231ad957cd66caef0f6f8e48a 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -129,7 +129,6 @@ cvar_t sv_gameplayfix_q1bsptracelinereportstexture = {CF_SERVER, "sv_gameplayfix
 cvar_t sv_gameplayfix_unstickplayers = {CF_SERVER, "sv_gameplayfix_unstickplayers", "0", "big hack to try and fix the rare case of MOVETYPE_WALK entities getting stuck in the world clipping hull."};
 cvar_t sv_gameplayfix_unstickentities = {CF_SERVER, "sv_gameplayfix_unstickentities", "1", "hack to check if entities are crossing world collision hull and try to move them to the right position, superseded by sv_gameplayfix_nudgeoutofsolid"};
 cvar_t sv_gameplayfix_fixedcheckwatertransition = {CF_SERVER, "sv_gameplayfix_fixedcheckwatertransition", "1", "fix two very stupid bugs in SV_CheckWaterTransition when watertype is CONTENTS_EMPTY (the bugs causes waterlevel to be 1 on first frame, -1 on second frame - the fix makes it 0 on both frames)"};
-cvar_t sv_gameplayfix_customstats = {CF_SERVER, "sv_gameplayfix_customstats", "0", "Disable stats higher than 220, for use by certain games such as Xonotic"};
 cvar_t sv_gravity = {CF_SERVER | CF_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"};
 cvar_t sv_init_frame_count = {CF_SERVER, "sv_init_frame_count", "2", "number of frames to run to allow everything to settle before letting clients connect"};
 cvar_t sv_idealpitchscale = {CF_SERVER, "sv_idealpitchscale","0.8", "how much to look up/down slopes and stairs when not using freelook"};
@@ -144,6 +143,7 @@ cvar_t sv_nostep = {CF_SERVER | CF_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_S
 cvar_t sv_playerphysicsqc = {CF_SERVER | CF_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"};
 cvar_t sv_progs = {CF_SERVER, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" };
 cvar_t sv_protocolname = {CF_SERVER, "sv_protocolname", "DP7", "selects network protocol to host for (values include QUAKE, QUAKEDP, NEHAHRAMOVIE, DP1 and up)"};
+cvar_t sv_qcstats = {CF_SERVER, "sv_qcstats", "0", "Disables engine sending of stats 220 and above, for use by certain games such as Xonotic, NOTE: it's strongly recommended that SVQC send correct STAT_MOVEVARS_TICRATE and STAT_MOVEVARS_TIMESCALE"};
 cvar_t sv_random_seed = {CF_SERVER, "sv_random_seed", "", "random seed; when set, on every map start this random seed is used to initialize the random number generator. Don't touch it unless for benchmarking or debugging"};
 cvar_t host_limitlocal = {CF_SERVER, "host_limitlocal", "0", "whether to apply rate limiting to the local player in a listen server (only useful for testing)"};
 cvar_t sv_sound_land = {CF_SERVER, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"};
@@ -613,7 +613,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_gameplayfix_unstickplayers);
        Cvar_RegisterVariable (&sv_gameplayfix_unstickentities);
        Cvar_RegisterVariable (&sv_gameplayfix_fixedcheckwatertransition);
-       Cvar_RegisterVariable (&sv_gameplayfix_customstats);
+       Cvar_RegisterVariable (&sv_qcstats);
        Cvar_RegisterVariable (&sv_gravity);
        Cvar_RegisterVariable (&sv_init_frame_count);
        Cvar_RegisterVariable (&sv_idealpitchscale);
index a9675530a9f98313657985c7ae2e5cb035134878..b7491e4a266af178a4204e6536ae383fc1467b8f 100644 (file)
--- a/sv_send.c
+++ b/sv_send.c
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "sv_demo.h"
 
 extern cvar_t sv_airaccel_qw_stretchfactor;
-extern cvar_t sv_gameplayfix_customstats;
+extern cvar_t sv_qcstats;
 extern cvar_t sv_warsowbunny_airforwardaccel;
 extern cvar_t sv_warsowbunny_accel;
 extern cvar_t sv_warsowbunny_topspeed;
@@ -1205,7 +1205,7 @@ void SV_WriteClientdataToMessage (client_t *client, prvm_edict_t *ent, sizebuf_t
        //stats[STAT_SECRETS] = PRVM_serverglobalfloat(found_secrets);
        //stats[STAT_MONSTERS] = PRVM_serverglobalfloat(killed_monsters);
 
-       if(!sv_gameplayfix_customstats.integer)
+       if(!sv_qcstats.integer)
        {
                statsf[STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR] = sv_airaccel_qw_stretchfactor.value;
                statsf[STAT_MOVEVARS_AIRCONTROL_PENALTY] = sv_aircontrol_penalty.value;
index a9d50af10c50008f3640642f8e8ac0a622eda71e..ab9dc257252bb9662497030cf1e3832b5de94061 100644 (file)
@@ -1762,7 +1762,7 @@ void VM_SV_UpdateCustomStats (client_t *client, prvm_edict_t *ent, sizebuf_t *ms
        }
 }
 
-extern cvar_t sv_gameplayfix_customstats;
+extern cvar_t sv_qcstats;
 
 // void(float index, float type, .void field) SV_AddStat = #232;
 // Set up an auto-sent player stat.
@@ -1813,9 +1813,9 @@ static void VM_SV_AddStat(prvm_prog_t *prog)
        // these are hazardous to override but sort of allowed if one wants to be adventurous...  and enjoys warnings.
        if (i < MIN_VM_STAT)
                VM_Warning(prog, "PF_SV_AddStat: index (%i) < MIN_VM_STAT (%i) may conflict with engine stats - allowed, but this may break things\n", i, MIN_VM_STAT);
-       else if (i >= MAX_VM_STAT && !sv_gameplayfix_customstats.integer)
+       else if (i >= MAX_VM_STAT && !sv_qcstats.integer)
                VM_Warning(prog, "PF_SV_AddStat: index (%i) >= MAX_VM_STAT (%i) conflicts with engine stats - allowed, but this may break slowmo and stuff\n", i, MAX_VM_STAT);
-       else if (i > (MAX_VM_STAT - 4) && type == 1 && !sv_gameplayfix_customstats.integer)
+       else if (i > (MAX_VM_STAT - 4) && type == 1 && !sv_qcstats.integer)
                VM_Warning(prog, "PF_SV_AddStat: index (%i) >= MAX_VM_STAT (%i) - 4 with string type won't fit within MAX_VM_STAT, thus conflicting with engine stats - allowed, but this may break slowmo and stuff\n", i, MAX_VM_STAT);
 
        vm_customstats[i].type          = type;