]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Finish off the last of the stats
authorMario <mario@smbclan.net>
Fri, 27 Nov 2015 14:48:44 +0000 (00:48 +1000)
committerMario <mario@smbclan.net>
Fri, 27 Nov 2015 14:48:44 +0000 (00:48 +1000)
qcsrc/common/mutators/mutator/dodging/dodging.qc
qcsrc/common/mutators/mutator/multijump/multijump.qc
qcsrc/common/physics.qc
qcsrc/common/physics.qh
qcsrc/common/stats.qh
qcsrc/server/defs.qh

index f014ebbc57b631d86088dd06ec558a5a07dfb4eb..c4deba5eab2d2c4e72b3bc870119c9e9f76ed186 100644 (file)
@@ -2,18 +2,18 @@
 
 #ifdef CSQC
        #define PHYS_DODGING_FRAMETIME                          (1 / (frametime <= 0 ? 60 : frametime))
-       #define PHYS_DODGING                                            getstati(STAT_DODGING)
-       #define PHYS_DODGING_DELAY                                      getstatf(STAT_DODGING_DELAY)
-       #define PHYS_DODGING_TIMEOUT(s)                         getstatf(STAT_DODGING_TIMEOUT)
-       #define PHYS_DODGING_HORIZ_SPEED_FROZEN         getstatf(STAT_DODGING_HORIZ_SPEED_FROZEN)
-       #define PHYS_DODGING_FROZEN_NODOUBLETAP         getstati(STAT_DODGING_FROZEN_NO_DOUBLETAP)
-       #define PHYS_DODGING_HORIZ_SPEED                        getstatf(STAT_DODGING_HORIZ_SPEED)
+       #define PHYS_DODGING                                            STAT(DODGING)
+       #define PHYS_DODGING_DELAY                                      STAT(DODGING_DELAY)
+       #define PHYS_DODGING_TIMEOUT(s)                         STAT(DODGING_TIMEOUT)
+       #define PHYS_DODGING_HORIZ_SPEED_FROZEN         STAT(DODGING_HORIZ_SPEED_FROZEN)
+       #define PHYS_DODGING_FROZEN_NODOUBLETAP         STAT(DODGING_FROZEN_NO_DOUBLETAP)
+       #define PHYS_DODGING_HORIZ_SPEED                        STAT(DODGING_HORIZ_SPEED)
        #define PHYS_DODGING_PRESSED_KEYS(s)            s.pressedkeys
-       #define PHYS_DODGING_HEIGHT_THRESHOLD           getstatf(STAT_DODGING_HEIGHT_THRESHOLD)
-       #define PHYS_DODGING_DISTANCE_THRESHOLD         getstatf(STAT_DODGING_DISTANCE_THRESHOLD)
-       #define PHYS_DODGING_RAMP_TIME                          getstatf(STAT_DODGING_RAMP_TIME)
-       #define PHYS_DODGING_UP_SPEED                           getstatf(STAT_DODGING_UP_SPEED)
-       #define PHYS_DODGING_WALL                                       getstatf(STAT_DODGING_WALL)
+       #define PHYS_DODGING_HEIGHT_THRESHOLD           STAT(DODGING_HEIGHT_THRESHOLD)
+       #define PHYS_DODGING_DISTANCE_THRESHOLD         STAT(DODGING_DISTANCE_THRESHOLD)
+       #define PHYS_DODGING_RAMP_TIME                          STAT(DODGING_RAMP_TIME)
+       #define PHYS_DODGING_UP_SPEED                           STAT(DODGING_UP_SPEED)
+       #define PHYS_DODGING_WALL                                       STAT(DODGING_WALL)
 #elif defined(SVQC)
        #define PHYS_DODGING_FRAMETIME                          sys_frametime
        #define PHYS_DODGING                                            g_dodging
@@ -54,19 +54,19 @@ float g_dodging;
 #include "../../../animdecide.qh"
 #include "../../../physics.qh"
 
-.float cvar_cl_dodging_timeout;
+.float cvar_cl_dodging_timeout = _STAT(DODGING_TIMEOUT);
 
-.float stat_dodging;
-.float stat_dodging_delay;
-.float stat_dodging_horiz_speed_frozen;
-.float stat_dodging_frozen_nodoubletap;
-.float stat_dodging_frozen;
-.float stat_dodging_horiz_speed;
-.float stat_dodging_height_threshold;
-.float stat_dodging_distance_threshold;
-.float stat_dodging_ramp_time;
-.float stat_dodging_up_speed;
-.float stat_dodging_wall;
+.float stat_dodging = _STAT(DODGING);
+.float stat_dodging_delay = _STAT(DODGING_DELAY);
+.float stat_dodging_horiz_speed_frozen = _STAT(DODGING_HORIZ_SPEED_FROZEN);
+.float stat_dodging_frozen_nodoubletap = _STAT(DODGING_FROZEN_NO_DOUBLETAP);
+.float stat_dodging_frozen = _STAT(DODGING_FROZEN);
+.float stat_dodging_horiz_speed = _STAT(DODGING_HORIZ_SPEED);
+.float stat_dodging_height_threshold = _STAT(DODGING_HEIGHT_THRESHOLD);
+.float stat_dodging_distance_threshold = _STAT(DODGING_DISTANCE_THRESHOLD);
+.float stat_dodging_ramp_time = _STAT(DODGING_RAMP_TIME);
+.float stat_dodging_up_speed = _STAT(DODGING_UP_SPEED);
+.float stat_dodging_wall = _STAT(DODGING_WALL);
 
 REGISTER_MUTATOR(dodging, cvar("g_dodging"))
 {
@@ -74,18 +74,6 @@ REGISTER_MUTATOR(dodging, cvar("g_dodging"))
        MUTATOR_ONADD
        {
                g_dodging = cvar("g_dodging");
-               addstat(STAT_DODGING, AS_INT, stat_dodging);
-               addstat(STAT_DODGING_DELAY, AS_FLOAT, stat_dodging_delay);
-               addstat(STAT_DODGING_TIMEOUT, AS_FLOAT, cvar_cl_dodging_timeout); // we stat this, so it is updated on the client when updated on server (otherwise, chaos)
-               addstat(STAT_DODGING_FROZEN_NO_DOUBLETAP, AS_INT, stat_dodging_frozen_nodoubletap);
-               addstat(STAT_DODGING_HORIZ_SPEED_FROZEN, AS_FLOAT, stat_dodging_horiz_speed_frozen);
-               addstat(STAT_DODGING_FROZEN, AS_INT, stat_dodging_frozen);
-               addstat(STAT_DODGING_HORIZ_SPEED, AS_FLOAT, stat_dodging_horiz_speed);
-               addstat(STAT_DODGING_HEIGHT_THRESHOLD, AS_FLOAT, stat_dodging_height_threshold);
-               addstat(STAT_DODGING_DISTANCE_THRESHOLD, AS_FLOAT, stat_dodging_distance_threshold);
-               addstat(STAT_DODGING_RAMP_TIME, AS_FLOAT, stat_dodging_ramp_time);
-               addstat(STAT_DODGING_UP_SPEED, AS_FLOAT, stat_dodging_up_speed);
-               addstat(STAT_DODGING_WALL, AS_FLOAT, stat_dodging_wall);
        }
 
        // this just turns off the cvar.
index 3ee7e020556627462c5380b4622767bf7981404c..688202cf9a3d273ff27305307ef3fd8f976ec0cf 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifdef CSQC
 
-#define PHYS_MULTIJUMP                                 getstati(STAT_MULTIJUMP)
-#define PHYS_MULTIJUMP_SPEED           getstatf(STAT_MULTIJUMP_SPEED)
-#define PHYS_MULTIJUMP_ADD                     getstati(STAT_MULTIJUMP_ADD)
+#define PHYS_MULTIJUMP                                 STAT(MULTIJUMP)
+#define PHYS_MULTIJUMP_SPEED           STAT(MULTIJUMP_SPEED)
+#define PHYS_MULTIJUMP_ADD                     STAT(MULTIJUMP_ADD)
 #define PHYS_MULTIJUMP_MAXSPEED        STAT(MULTIJUMP_MAXSPEED)
 #define PHYS_MULTIJUMP_DODGING                 STAT(MULTIJUMP_DODGING)
 
@@ -30,26 +30,19 @@ float autocvar_g_multijump_dodging = 1;
 #define PHYS_MULTIJUMP_MAXSPEED        autocvar_g_multijump_maxspeed
 #define PHYS_MULTIJUMP_DODGING                 autocvar_g_multijump_dodging
 
-.float stat_multijump;
-.float stat_multijump_speed;
-.float stat_multijump_add;
+.float stat_multijump = _STAT(MULTIJUMP);
+.float stat_multijump_speed = _STAT(MULTIJUMP_SPEED);
+.float stat_multijump_add = _STAT(MULTIJUMP_ADD);
 .float stat_multijump_maxspeed = _STAT(MULTIJUMP_MAXSPEED);
 .float stat_multijump_dodging = _STAT(MULTIJUMP_DODGING);
 
 void multijump_UpdateStats()
 {SELFPARAM();
-       self.stat_multijump = PHYS_MULTIJUMP;
-       self.stat_multijump_speed = PHYS_MULTIJUMP_SPEED;
-       self.stat_multijump_add = PHYS_MULTIJUMP_ADD;
-       self.stat_multijump_maxspeed = PHYS_MULTIJUMP_MAXSPEED;
-       self.stat_multijump_dodging = PHYS_MULTIJUMP_DODGING;
-}
-
-void multijump_AddStats()
-{
-       addstat(STAT_MULTIJUMP, AS_INT, stat_multijump);
-       addstat(STAT_MULTIJUMP_SPEED, AS_FLOAT, stat_multijump_speed);
-       addstat(STAT_MULTIJUMP_ADD, AS_INT, stat_multijump_add);
+       STAT(MULTIJUMP, this) = PHYS_MULTIJUMP;
+       STAT(MULTIJUMP_SPEED, this) = PHYS_MULTIJUMP_SPEED;
+       STAT(MULTIJUMP_ADD, this) = PHYS_MULTIJUMP_ADD;
+       STAT(MULTIJUMP_MAXSPEED, this) = PHYS_MULTIJUMP_MAXSPEED;
+       STAT(MULTIJUMP_DODGING, this) = PHYS_MULTIJUMP_DODGING;
 }
 
 #endif
@@ -141,14 +134,7 @@ bool PM_multijump_checkjump()
 }
 
 #ifdef SVQC
-REGISTER_MUTATOR(multijump, cvar("g_multijump"))
-{
-       MUTATOR_ONADD
-       {
-               multijump_AddStats();
-       }
-       return false;
-}
+REGISTER_MUTATOR(multijump, cvar("g_multijump"));
 
 MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics)
 {
index 835f1dbe82b2b5ae116b476a744dd61fd4eabc5a..341a40f2e5759c5e3b7c1e2abdb9b45d49f17707 100644 (file)
@@ -57,30 +57,6 @@ void Physics_AddStats()
        // g_movementspeed hack
        addstat(STAT_MOVEVARS_MAXSPEED, AS_FLOAT, stat_sv_maxspeed);
        addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
-       addstat(STAT_MOVEVARS_HIGHSPEED, AS_FLOAT, stat_movement_highspeed);
-
-       // jet pack
-       addstat(STAT_JETPACK_ACCEL_SIDE, AS_FLOAT, stat_jetpack_accel_side);
-       addstat(STAT_JETPACK_ACCEL_UP, AS_FLOAT, stat_jetpack_accel_up);
-       addstat(STAT_JETPACK_ANTIGRAVITY, AS_FLOAT, stat_jetpack_antigravity);
-       addstat(STAT_JETPACK_FUEL, AS_FLOAT, stat_jetpack_fuel);
-       addstat(STAT_JETPACK_MAXSPEED_UP, AS_FLOAT, stat_jetpack_maxspeed_up);
-       addstat(STAT_JETPACK_MAXSPEED_SIDE, AS_FLOAT, stat_jetpack_maxspeed_side);
-
-       // hack to fix track_canjump
-       addstat(STAT_MOVEVARS_CL_TRACK_CANJUMP, AS_INT, cvar_cl_movement_track_canjump);
-       addstat(STAT_MOVEVARS_TRACK_CANJUMP, AS_INT, stat_sv_track_canjump);
-
-       // double jump
-       addstat(STAT_DOUBLEJUMP, AS_INT, stat_doublejump);
-
-       // jump speed caps
-       addstat(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, AS_INT, stat_jumpspeedcap_disable_onramps);
-
-       // hacks
-       addstat(STAT_MOVEVARS_FRICTION_ONLAND, AS_FLOAT, stat_sv_friction_on_land);
-       addstat(STAT_MOVEVARS_FRICTION_SLICK, AS_FLOAT, stat_sv_friction_slick);
-       addstat(STAT_GAMEPLAYFIX_EASIERWATERJUMP, AS_INT, stat_gameplayfix_easierwaterjump);
 
        // new properties
        addstat(STAT_MOVEVARS_JUMPVELOCITY, AS_FLOAT, stat_sv_jumpvelocity);
@@ -119,23 +95,32 @@ void Physics_UpdateStats(float maxspd_mod)
                : 0;
        STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, this) = Physics_ClientOption(self, "airspeedlimit_nonqw") * maxspd_mod;
        self.stat_sv_maxspeed = Physics_ClientOption(self, "maxspeed") * maxspd_mod; // also slow walking
-       self.stat_movement_highspeed = PHYS_HIGHSPEED; // TODO: remove this!
+       STAT(MOVEVARS_HIGHSPEED, this) = PHYS_HIGHSPEED; // TODO: remove this!
+
+       STAT(DOUBLEJUMP, this) = PHYS_DOUBLEJUMP;
+
+       STAT(JETPACK_ANTIGRAVITY, this) = PHYS_JETPACK_ANTIGRAVITY;
+       STAT(JETPACK_ACCEL_UP, this) = PHYS_JETPACK_ACCEL_UP;
+       STAT(JETPACK_ACCEL_SIDE, this) = PHYS_JETPACK_ACCEL_SIDE;
+       STAT(JETPACK_MAXSPEED_SIDE, this) = PHYS_JETPACK_MAXSPEED_SIDE;
+       STAT(JETPACK_MAXSPEED_UP, this) = PHYS_JETPACK_MAXSPEED_UP;
+       STAT(JETPACK_FUEL, this) = PHYS_JETPACK_FUEL;
+
+       STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, this) = PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS;
 
-       self.stat_doublejump = PHYS_DOUBLEJUMP;
+       STAT(MOVEVARS_FRICTION_ONLAND, this) = PHYS_FRICTION_ONLAND;
+       STAT(MOVEVARS_FRICTION_SLICK, this) = PHYS_FRICTION_SLICK;
 
-       self.stat_jetpack_antigravity = PHYS_JETPACK_ANTIGRAVITY;
-       self.stat_jetpack_accel_up = PHYS_JETPACK_ACCEL_UP;
-       self.stat_jetpack_accel_side = PHYS_JETPACK_ACCEL_SIDE;
-       self.stat_jetpack_maxspeed_side = PHYS_JETPACK_MAXSPEED_SIDE;
-       self.stat_jetpack_maxspeed_up = PHYS_JETPACK_MAXSPEED_UP;
-       self.stat_jetpack_fuel = PHYS_JETPACK_FUEL;
+       STAT(MOVEVARS_JUMPSTEP, this) = PHYS_JUMPSTEP;
 
-       self.stat_jumpspeedcap_disable_onramps = PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS;
+       STAT(GAMEPLAYFIX_STEPDOWN, this) = GAMEPLAYFIX_STEPDOWN;
 
-       self.stat_sv_friction_on_land = PHYS_FRICTION_ONLAND;
-       self.stat_sv_friction_slick = PHYS_FRICTION_SLICK;
+       STAT(NOSTEP, this) = PHYS_NOSTEP;
 
-       self.stat_gameplayfix_easierwaterjump = GAMEPLAYFIX_EASIERWATERJUMP;
+       STAT(GAMEPLAYFIX_EASIERWATERJUMP, this) = GAMEPLAYFIX_EASIERWATERJUMP;
+       STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, this) = GAMEPLAYFIX_DOWNTRACEONGROUND;
+       STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, this) = GAMEPLAYFIX_STEPMULTIPLETIMES;
+       STAT(GAMEPLAYFIX_UNSTICKPLAYERS, this) = GAMEPLAYFIX_UNSTICKPLAYERS;
 
 
        // old stats
@@ -160,7 +145,7 @@ void Physics_UpdateStats(float maxspd_mod)
        self.stat_sv_airstopaccelerate = Physics_ClientOption(self, "airstopaccelerate");
        self.stat_sv_jumpvelocity = Physics_ClientOption(self, "jumpvelocity");
 
-       self.stat_sv_track_canjump = Physics_ClientOption(self, "track_canjump");
+       STAT(MOVEVARS_TRACK_CANJUMP, this) = Physics_ClientOption(self, "track_canjump");
 
        self.stat_gameplayfix_upvelocityclearsonground = UPWARD_VELOCITY_CLEARS_ONGROUND;
 }
index 821568411c295026e5410b6cdab126d79ed42703..e70b489fd6fe0c72a218b438b6c9d81e931c3c5e 100644 (file)
@@ -77,11 +77,11 @@ bool IsFlying(entity a);
        #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE  !!(moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
        #define GAMEPLAYFIX_NOGRAVITYONGROUND                   cvar("sv_gameplayfix_nogravityonground")
        #define GAMEPLAYFIX_Q2AIRACCELERATE                             cvar("sv_gameplayfix_q2airaccelerate")
-       #define GAMEPLAYFIX_EASIERWATERJUMP                     getstati(STAT_GAMEPLAYFIX_EASIERWATERJUMP)
-       #define GAMEPLAYFIX_DOWNTRACEONGROUND                   getstati(STAT_GAMEPLAYFIX_DOWNTRACEONGROUND)
-       #define GAMEPLAYFIX_STEPMULTIPLETIMES                   getstati(STAT_GAMEPLAYFIX_STEPMULTIPLETIMES)
-       #define GAMEPLAYFIX_UNSTICKPLAYERS                              getstati(STAT_GAMEPLAYFIX_UNSTICKPLAYERS)
-       #define GAMEPLAYFIX_STEPDOWN                                    getstati(STAT_GAMEPLAYFIX_STEPDOWN)
+       #define GAMEPLAYFIX_EASIERWATERJUMP                     STAT(GAMEPLAYFIX_EASIERWATERJUMP)
+       #define GAMEPLAYFIX_DOWNTRACEONGROUND                   STAT(GAMEPLAYFIX_DOWNTRACEONGROUND)
+       #define GAMEPLAYFIX_STEPMULTIPLETIMES                   STAT(GAMEPLAYFIX_STEPMULTIPLETIMES)
+       #define GAMEPLAYFIX_UNSTICKPLAYERS                              STAT(GAMEPLAYFIX_UNSTICKPLAYERS)
+       #define GAMEPLAYFIX_STEPDOWN                                    STAT(GAMEPLAYFIX_STEPDOWN)
 
        #define IS_DUCKED(s)                                            !!(s.flags & FL_DUCKED)
        #define SET_DUCKED(s)                                           s.flags |= FL_DUCKED
@@ -102,7 +102,7 @@ bool IsFlying(entity a);
 
        #define PHYS_FROZEN(s)                                          STAT(FROZEN)
 
-       #define PHYS_DOUBLEJUMP                                         getstati(STAT_DOUBLEJUMP)
+       #define PHYS_DOUBLEJUMP                                         STAT(DOUBLEJUMP)
 
        #define PHYS_BUGRIGS                                            STAT(BUGRIGS)
        #define PHYS_BUGRIGS_ANGLE_SMOOTHING            STAT(BUGRIGS_ANGLE_SMOOTHING)
@@ -122,10 +122,10 @@ bool IsFlying(entity a);
 
        #define PHYS_JUMPSPEEDCAP_MIN                           cvar_string("cl_jumpspeedcap_min")
        #define PHYS_JUMPSPEEDCAP_MAX                           cvar_string("cl_jumpspeedcap_max")
-       #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS       getstati(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS)
+       #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS       STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS)
 
-       #define PHYS_CL_TRACK_CANJUMP(s)                        getstati(STAT_MOVEVARS_CL_TRACK_CANJUMP)
-       #define PHYS_TRACK_CANJUMP(s)                           getstati(STAT_MOVEVARS_TRACK_CANJUMP)
+       #define PHYS_CL_TRACK_CANJUMP(s)                        STAT(MOVEVARS_CL_TRACK_CANJUMP)
+       #define PHYS_TRACK_CANJUMP(s)                           STAT(MOVEVARS_TRACK_CANJUMP)
        #define PHYS_ACCELERATE                                         getstatf(STAT_MOVEVARS_ACCELERATE)
        #define PHYS_AIRACCEL_QW(s)                                     getstatf(STAT_MOVEVARS_AIRACCEL_QW)
        #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s)       STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, s)
@@ -140,10 +140,10 @@ bool IsFlying(entity a);
        #define PHYS_AIRSTRAFEACCELERATE(s)                     getstatf(STAT_MOVEVARS_AIRSTRAFEACCELERATE)
        #define PHYS_ENTGRAVITY(s)                                      STAT(MOVEVARS_ENTGRAVITY)
        #define PHYS_FRICTION                                           getstatf(STAT_MOVEVARS_FRICTION)
-       #define PHYS_FRICTION_SLICK                                     getstatf(STAT_MOVEVARS_FRICTION_SLICK)
-       #define PHYS_FRICTION_ONLAND                            getstatf(STAT_MOVEVARS_FRICTION_ONLAND)
+       #define PHYS_FRICTION_SLICK                                     STAT(MOVEVARS_FRICTION_SLICK)
+       #define PHYS_FRICTION_ONLAND                            STAT(MOVEVARS_FRICTION_ONLAND)
        #define PHYS_GRAVITY                                            STAT(MOVEVARS_GRAVITY)
-       #define PHYS_HIGHSPEED                                          getstatf(STAT_MOVEVARS_HIGHSPEED)
+       #define PHYS_HIGHSPEED                                          STAT(MOVEVARS_HIGHSPEED)
        #define PHYS_JUMPVELOCITY                                       getstatf(STAT_MOVEVARS_JUMPVELOCITY)
        #define PHYS_MAXAIRSPEED(s)                                     getstatf(STAT_MOVEVARS_MAXAIRSPEED)
        #define PHYS_MAXAIRSTRAFESPEED                          getstatf(STAT_MOVEVARS_MAXAIRSTRAFESPEED)
@@ -158,17 +158,17 @@ bool IsFlying(entity a);
 
        #define PHYS_WALLFRICTION                                       STAT(MOVEVARS_WALLFRICTION)
 
-       #define PHYS_JETPACK_ACCEL_UP                           getstatf(STAT_JETPACK_ACCEL_UP)
-       #define PHYS_JETPACK_ACCEL_SIDE                         getstatf(STAT_JETPACK_ACCEL_SIDE)
-       #define PHYS_JETPACK_ANTIGRAVITY                        getstatf(STAT_JETPACK_ANTIGRAVITY)
-       #define PHYS_JETPACK_FUEL                                       getstatf(STAT_JETPACK_FUEL)
-       #define PHYS_JETPACK_MAXSPEED_UP                        getstatf(STAT_JETPACK_MAXSPEED_UP)
-       #define PHYS_JETPACK_MAXSPEED_SIDE                      getstatf(STAT_JETPACK_MAXSPEED_SIDE)
+       #define PHYS_JETPACK_ACCEL_UP                           STAT(JETPACK_ACCEL_UP)
+       #define PHYS_JETPACK_ACCEL_SIDE                         STAT(JETPACK_ACCEL_SIDE)
+       #define PHYS_JETPACK_ANTIGRAVITY                        STAT(JETPACK_ANTIGRAVITY)
+       #define PHYS_JETPACK_FUEL                                       STAT(JETPACK_FUEL)
+       #define PHYS_JETPACK_MAXSPEED_UP                        STAT(JETPACK_MAXSPEED_UP)
+       #define PHYS_JETPACK_MAXSPEED_SIDE                      STAT(JETPACK_MAXSPEED_SIDE)
 
-       #define PHYS_DODGING_FROZEN                                     getstati(STAT_DODGING_FROZEN)
+       #define PHYS_DODGING_FROZEN                                     STAT(DODGING_FROZEN)
 
-       #define PHYS_NOSTEP                                                     getstati(STAT_NOSTEP)
-       #define PHYS_JUMPSTEP                                           getstati(STAT_MOVEVARS_JUMPSTEP)
+       #define PHYS_NOSTEP                                                     STAT(NOSTEP)
+       #define PHYS_JUMPSTEP                                           STAT(MOVEVARS_JUMPSTEP)
 
 #elif defined(SVQC)
 
@@ -185,28 +185,28 @@ bool IsFlying(entity a);
        .float stat_sv_airaccel_qw;
        .float stat_sv_airspeedlimit_nonqw = _STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW);
        .float stat_sv_maxspeed;
-       .float stat_movement_highspeed;
+       .float stat_movement_highspeed = _STAT(MOVEVARS_HIGHSPEED);
 
-       .float stat_sv_friction_on_land;
-       .float stat_sv_friction_slick;
+       .float stat_sv_friction_on_land = _STAT(MOVEVARS_FRICTION_ONLAND);
+       .float stat_sv_friction_slick = _STAT(MOVEVARS_FRICTION_SLICK);
 
-       .float stat_doublejump;
+       .float stat_doublejump = _STAT(DOUBLEJUMP);
 
        .string stat_jumpspeedcap_min;
        .string stat_jumpspeedcap_max;
-       .float stat_jumpspeedcap_disable_onramps;
-
-       .float stat_jetpack_accel_side;
-       .float stat_jetpack_accel_up;
-       .float stat_jetpack_antigravity;
-       .float stat_jetpack_fuel;
-       .float stat_jetpack_maxspeed_up;
-       .float stat_jetpack_maxspeed_side;
-       .float stat_gameplayfix_easierwaterjump;
-       .float stat_gameplayfix_downtracesupportsongroundflag;
-       .float stat_gameplayfix_stepmultipletimes;
-       .float stat_gameplayfix_unstickplayers;
-       .float stat_gameplayfix_stepdown;
+       .float stat_jumpspeedcap_disable_onramps = _STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS);
+
+       .float stat_jetpack_accel_side = _STAT(JETPACK_ACCEL_SIDE);
+       .float stat_jetpack_accel_up = _STAT(JETPACK_ACCEL_UP);
+       .float stat_jetpack_antigravity = _STAT(JETPACK_ANTIGRAVITY);
+       .float stat_jetpack_fuel = _STAT(JETPACK_FUEL);
+       .float stat_jetpack_maxspeed_up = _STAT(JETPACK_MAXSPEED_UP);
+       .float stat_jetpack_maxspeed_side = _STAT(JETPACK_MAXSPEED_SIDE);
+       .float stat_gameplayfix_easierwaterjump = _STAT(GAMEPLAYFIX_EASIERWATERJUMP);
+       .float stat_gameplayfix_downtracesupportsongroundflag = _STAT(GAMEPLAYFIX_DOWNTRACEONGROUND);
+       .float stat_gameplayfix_stepmultipletimes = _STAT(GAMEPLAYFIX_STEPMULTIPLETIMES);
+       .float stat_gameplayfix_unstickplayers = _STAT(GAMEPLAYFIX_UNSTICKPLAYERS);
+       .float stat_gameplayfix_stepdown = _STAT(GAMEPLAYFIX_STEPDOWN);
 
        .float stat_bugrigs = _STAT(BUGRIGS);
        .float stat_bugrigs_angle_smoothing = _STAT(BUGRIGS_ANGLE_SMOOTHING);
@@ -242,10 +242,10 @@ bool IsFlying(entity a);
        .float stat_sv_airaccelerate;
        .float stat_sv_airstopaccelerate;
 
-       .float stat_nostep;
-       .float stat_jumpstep;
+       .float stat_nostep = _STAT(NOSTEP);
+       .float stat_jumpstep = _STAT(MOVEVARS_JUMPSTEP);
 
-       .bool stat_sv_track_canjump;
+       .bool stat_sv_track_canjump = _STAT(MOVEVARS_TRACK_CANJUMP);
 
        #define PHYS_INPUT_ANGLES(s)                            s.v_angle
        #define PHYS_WORLD_ANGLES(s)                            s.angles
index 4f1d5812a399034eb3323694b82cab5c016d45f4..e8c05c7183b216c5c992cdf787cc7422f5257ceb 100644 (file)
@@ -53,7 +53,7 @@ enum {
     STAT_LAST_VECTOR
 };
 
-const int REGISTERED_STATS = 86;
+const int REGISTERED_STATS = 121;
 
 REGISTER_STAT(KH_KEYS, int)
 /** weapon requested to switch to; next WANTED weapon (for HUD) */
@@ -132,46 +132,45 @@ REGISTER_STAT(BUGRIGS_REVERSE_SPEEDING, int)
 REGISTER_STAT(BUGRIGS_PLANAR_MOVEMENT, int)
 REGISTER_STAT(BUGRIGS_ANGLE_SMOOTHING, int)
 REGISTER_STAT(BUGRIGS, int)
+REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int)
+REGISTER_STAT(MOVEVARS_JUMPSTEP, int)
+REGISTER_STAT(NOSTEP, int)
+REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int)
+REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int)
+REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int)
+REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int)
+REGISTER_STAT(MOVEVARS_FRICTION_SLICK, float)
+REGISTER_STAT(MOVEVARS_FRICTION_ONLAND, float)
+REGISTER_STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, int)
+REGISTER_STAT(MOVEVARS_TRACK_CANJUMP, int)
+REGISTER_STAT(DOUBLEJUMP, int)
+REGISTER_STAT(MOVEVARS_CL_TRACK_CANJUMP, int)
+REGISTER_STAT(MULTIJUMP_ADD, int)
+REGISTER_STAT(MULTIJUMP_SPEED, float)
+REGISTER_STAT(MULTIJUMP, int)
+REGISTER_STAT(DODGING_TIMEOUT, float)
+REGISTER_STAT(DODGING_WALL, int)
+REGISTER_STAT(DODGING_UP_SPEED, float)
+REGISTER_STAT(DODGING_RAMP_TIME, float)
+REGISTER_STAT(DODGING_HEIGHT_THRESHOLD, float)
+REGISTER_STAT(DODGING_DISTANCE_THRESHOLD, float)
+REGISTER_STAT(DODGING_HORIZ_SPEED, float)
+REGISTER_STAT(DODGING_DELAY, float)
+REGISTER_STAT(DODGING_FROZEN_NO_DOUBLETAP, int)
+REGISTER_STAT(DODGING_HORIZ_SPEED_FROZEN, float)
+REGISTER_STAT(DODGING, int)
+REGISTER_STAT(DODGING_FROZEN, int)
+REGISTER_STAT(JETPACK_MAXSPEED_UP, float)
+REGISTER_STAT(JETPACK_MAXSPEED_SIDE, float)
+REGISTER_STAT(JETPACK_FUEL, float)
+REGISTER_STAT(JETPACK_ANTIGRAVITY, float)
+REGISTER_STAT(JETPACK_ACCEL_SIDE, float)
+REGISTER_STAT(JETPACK_ACCEL_UP, float)
+REGISTER_STAT(MOVEVARS_HIGHSPEED, float)
 
 enum {
     STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
 
-    STAT_GAMEPLAYFIX_STEPDOWN,
-    STAT_MOVEVARS_JUMPSTEP,
-    STAT_NOSTEP,
-    STAT_GAMEPLAYFIX_UNSTICKPLAYERS,
-    STAT_GAMEPLAYFIX_STEPMULTIPLETIMES,
-    STAT_GAMEPLAYFIX_DOWNTRACEONGROUND,
-    STAT_GAMEPLAYFIX_EASIERWATERJUMP,
-    STAT_MOVEVARS_FRICTION_SLICK,
-    STAT_MOVEVARS_FRICTION_ONLAND,
-    STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS,
-    STAT_MOVEVARS_TRACK_CANJUMP,
-    STAT_DOUBLEJUMP,
-    STAT_MOVEVARS_CL_TRACK_CANJUMP,
-    STAT_MULTIJUMP_ADD,
-    STAT_MULTIJUMP_SPEED,
-    STAT_MULTIJUMP,
-    STAT_DODGING_TIMEOUT,
-    STAT_DODGING_WALL,
-    STAT_DODGING_UP_SPEED,
-    STAT_DODGING_RAMP_TIME,
-    STAT_DODGING_HEIGHT_THRESHOLD,
-    STAT_DODGING_DISTANCE_THRESHOLD,
-    STAT_DODGING_HORIZ_SPEED,
-    STAT_DODGING_DELAY,
-    STAT_DODGING_FROZEN_NO_DOUBLETAP,
-    STAT_DODGING_HORIZ_SPEED_FROZEN,
-    STAT_DODGING,
-    STAT_DODGING_FROZEN,
-    STAT_JETPACK_MAXSPEED_UP,
-    STAT_JETPACK_MAXSPEED_SIDE,
-    STAT_JETPACK_FUEL,
-    STAT_JETPACK_ANTIGRAVITY,
-    STAT_JETPACK_ACCEL_SIDE,
-    STAT_JETPACK_ACCEL_UP,
-    STAT_MOVEVARS_HIGHSPEED,
-
     STAT_LAST_MAIN
 };
 
index 88a994d8408afe165b155b8a54136cf5f38ecb83..a54ca8cc3b92374e282139ff4cd5a62aebd64eae 100644 (file)
@@ -227,7 +227,7 @@ float default_weapon_alpha;
 .float cvar_cl_clippedspectating;
 .float cvar_cl_autoscreenshot;
 .float cvar_cl_jetpack_jump;
-.float cvar_cl_movement_track_canjump;
+.float cvar_cl_movement_track_canjump = _STAT(MOVEVARS_CL_TRACK_CANJUMP);
 .float cvar_cl_newusekeysupported;
 
 .string cvar_g_xonoticversion;