Merge branch 'master' into TimePath/csqc_viewmodels
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / stats.qh
index 68bfbe8332ee4b5b881b79a7f04da839fe8f6093..be3e10f5ef1bd1e06fdac0591ce4393d8fe41e67 100644 (file)
 // Full list of all stat constants, included in a single location for easy reference
 // 255 is the current limit (MAX_CL_STATS - 1), engine will need to be modified if you wish to add more stats
 
-const int MAX_CL_STATS                = 256;
-// -Wdouble-declaration
-// const int STAT_HEALTH                 = 0;
-// 1 empty?
-const int STAT_WEAPON                 = 2;
-// -Wdouble-declaration
-// const int STAT_AMMO                   = 3;
-// -Wdouble-declaration
-// const int STAT_ARMOR                  = 4;
-// -Wdouble-declaration
-// const int STAT_WEAPONFRAME            = 5;
-// -Wdouble-declaration
-// const int STAT_SHELLS                 = 6;
-// -Wdouble-declaration
-// const int STAT_NAILS                  = 7;
-// -Wdouble-declaration
-// const int STAT_ROCKETS                = 8;
-// -Wdouble-declaration
-// const int STAT_CELLS                  = 9;
-// -Wdouble-declaration
-// const int STAT_ACTIVEWEAPON           = 10;
-// -Wdouble-declaration
-// const int STAT_TOTALSECRETS           = 11;
-// -Wdouble-declaration
-// const int STAT_TOTALMONSTERS          = 12;
-// -Wdouble-declaration
-// const int STAT_SECRETS                = 13;
-// -Wdouble-declaration
-// const int STAT_MONSTERS               = 14;
-// -Wdouble-declaration
-// const int STAT_ITEMS                  = 15;
-// -Wdouble-declaration
-// const int STAT_VIEWHEIGHT             = 16;
-// 17 empty?
-// 18 empty?
-// 19 empty?
-// 20 empty?
-const int STAT_VIEWZOOM               = 21;
-// 22 empty?
-// 23 empty?
-// 24 empty?
-// 25 empty?
-// 26 empty?
-// 27 empty?
-// 28 empty?
-// 29 empty?
-// 30 empty?
-// 31 empty?
-const int STAT_KH_KEYS                = 32;
-const int STAT_CTF_STATE              = 33;
-// 34 empty?
-const int STAT_WEAPONS                = 35;
-const int STAT_SWITCHWEAPON           = 36;
-const int STAT_GAMESTARTTIME          = 37;
-const int STAT_STRENGTH_FINISHED      = 38;
-const int STAT_INVINCIBLE_FINISHED    = 39;
-// 40 empty?
-const int STAT_ARC_HEAT               = 41;
-const int STAT_PRESSED_KEYS           = 42;
-const int STAT_ALLOW_OLDVORTEXBEAM    = 43; // this stat could later contain some other bits of info, like, more server-side particle config
-const int STAT_FUEL                   = 44;
-const int STAT_NB_METERSTART          = 45;
-const int STAT_SHOTORG                = 46; // compressShotOrigin
-const int STAT_LEADLIMIT              = 47;
-const int STAT_WEAPON_CLIPLOAD        = 48;
-const int STAT_WEAPON_CLIPSIZE        = 49;
-const int STAT_VORTEX_CHARGE          = 50;
-const int STAT_LAST_PICKUP            = 51;
-const int STAT_HUD                    = 52;
-const int STAT_VORTEX_CHARGEPOOL      = 53;
-const int STAT_HIT_TIME               = 54;
-const int STAT_DAMAGE_DEALT_TOTAL     = 55;
-const int STAT_TYPEHIT_TIME           = 56;
-const int STAT_LAYED_MINES            = 57;
-const int STAT_HAGAR_LOAD             = 58;
-const int STAT_SWITCHINGWEAPON        = 59;
-const int STAT_SUPERWEAPONS_FINISHED  = 60;
-const int STAT_VEHICLESTAT_HEALTH     = 61;
-const int STAT_VEHICLESTAT_SHIELD     = 62;
-const int STAT_VEHICLESTAT_ENERGY     = 63;
-const int STAT_VEHICLESTAT_AMMO1      = 64;
-const int STAT_VEHICLESTAT_RELOAD1    = 65;
-const int STAT_VEHICLESTAT_AMMO2      = 66;
-const int STAT_VEHICLESTAT_RELOAD2    = 67;
-const int STAT_VEHICLESTAT_W2MODE     = 68;
-const int STAT_NADE_TIMER             = 69;
-const int STAT_SECRETS_TOTAL          = 70;
-const int STAT_SECRETS_FOUND          = 71;
-const int STAT_RESPAWN_TIME           = 72;
-const int STAT_ROUNDSTARTTIME         = 73;
-const int STAT_WEAPONS2               = 74;
-const int STAT_WEAPONS3               = 75;
-const int STAT_MONSTERS_TOTAL         = 76;
-const int STAT_MONSTERS_KILLED        = 77;
-const int STAT_BUFFS                  = 78;
-const int STAT_NADE_BONUS             = 79;
-const int STAT_NADE_BONUS_TYPE        = 80;
-const int STAT_NADE_BONUS_SCORE       = 81;
-const int STAT_HEALING_ORB            = 82;
-const int STAT_HEALING_ORB_ALPHA      = 83;
-const int STAT_PLASMA                 = 84;
-const int STAT_OK_AMMO_CHARGE         = 85;
-const int STAT_OK_AMMO_CHARGEPOOL     = 86;
-const int STAT_FROZEN                 = 87;
-const int STAT_REVIVE_PROGRESS        = 88;
-const int STAT_WEAPON_NEXTTHINK       = 89;
-// 90 empty?
-// 91 empty?
-// 92 empty?
-// 93 empty?
-// 94 empty?
-// 95 empty?
-// 96 empty?
-// 97 empty?
-// 98 empty?
-const int STAT_ROUNDLOST              = 99;
+const int MAX_CL_STATS = 256;
+#ifndef CSQC
+const int STAT_HEALTH = 0; // .health
+const int STAT_ARMOR = 4; // .armorvalue
+const int STAT_SHELLS = 6; // .ammo_shells
+const int STAT_NAILS = 7; // .ammo_nails
+const int STAT_ROCKETS = 8; // .ammo_rockets
+const int STAT_CELLS = 9; // .ammo_cells
+const int STAT_ACTIVEWEAPON = 10; // .weapon
+const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28
+const int STAT_VIEWHEIGHT = 16; // .view_ofs_z
+#endif
+
+REGISTER_STAT(WEAPONS, vectori)
+REGISTER_STAT(WEAPONSINMAP, vectori)
+
+REGISTER_STAT(PL_VIEW_OFS, vector, autocvar_sv_player_viewoffset)
+REGISTER_STAT(PL_CROUCH_VIEW_OFS, vector, autocvar_sv_player_crouch_viewoffset)
+
+REGISTER_STAT(PL_MIN, vector, autocvar_sv_player_mins)
+REGISTER_STAT(PL_CROUCH_MIN, vector, autocvar_sv_player_crouch_mins)
+
+REGISTER_STAT(PL_MAX, vector, autocvar_sv_player_maxs)
+REGISTER_STAT(PL_CROUCH_MAX, vector, autocvar_sv_player_crouch_maxs)
+
+REGISTER_STAT(KH_KEYS, int)
+
+/** weapon requested to switch to; next WANTED weapon (for HUD) */
+REGISTER_STAT(SWITCHWEAPON, int)
+/** weapon currently being switched to (is copied from switchweapon once switch is possible) */
+REGISTER_STAT(SWITCHINGWEAPON, int)
+REGISTER_STAT(WEAPON_NEXTTHINK, float)
+
+REGISTER_STAT(GAMESTARTTIME, float)
+REGISTER_STAT(STRENGTH_FINISHED, float)
+REGISTER_STAT(INVINCIBLE_FINISHED, float)
+/** arc heat in [0,1] */
+REGISTER_STAT(ARC_HEAT, float)
+REGISTER_STAT(PRESSED_KEYS, int)
+/** this stat could later contain some other bits of info, like, more server-side particle config */
+REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool)
+REGISTER_STAT(FUEL, int)
+REGISTER_STAT(NB_METERSTART, float)
+/** compressShotOrigin */
+REGISTER_STAT(SHOTORG, int)
+REGISTER_STAT(LEADLIMIT, float)
+REGISTER_STAT(WEAPON_CLIPLOAD, int)
+REGISTER_STAT(WEAPON_CLIPSIZE, int)
+
+REGISTER_STAT(VORTEX_CHARGE, float)
+REGISTER_STAT(LAST_PICKUP, float)
+REGISTER_STAT(HUD, int)
+REGISTER_STAT(VORTEX_CHARGEPOOL, float)
+REGISTER_STAT(HIT_TIME, float)
+REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
+REGISTER_STAT(TYPEHIT_TIME, float)
+REGISTER_STAT(LAYED_MINES, int)
+REGISTER_STAT(HAGAR_LOAD, int)
+REGISTER_STAT(SUPERWEAPONS_FINISHED, float)
+REGISTER_STAT(VEHICLESTAT_HEALTH, int)
+REGISTER_STAT(VEHICLESTAT_SHIELD, int)
+REGISTER_STAT(VEHICLESTAT_ENERGY, int)
+REGISTER_STAT(VEHICLESTAT_AMMO1, int)
+REGISTER_STAT(VEHICLESTAT_RELOAD1, int)
+REGISTER_STAT(VEHICLESTAT_AMMO2, int)
+REGISTER_STAT(VEHICLESTAT_RELOAD2, int)
+REGISTER_STAT(VEHICLESTAT_W2MODE, int)
+REGISTER_STAT(NADE_TIMER, float)
+REGISTER_STAT(SECRETS_TOTAL, float)
+REGISTER_STAT(SECRETS_FOUND, float)
+REGISTER_STAT(RESPAWN_TIME, float)
+REGISTER_STAT(ROUNDSTARTTIME, float)
+REGISTER_STAT(MONSTERS_TOTAL, int)
+REGISTER_STAT(MONSTERS_KILLED, int)
+REGISTER_STAT(BUFFS, int)
+REGISTER_STAT(NADE_BONUS, float)
+REGISTER_STAT(NADE_BONUS_TYPE, int)
+REGISTER_STAT(NADE_BONUS_SCORE, float)
+REGISTER_STAT(HEALING_ORB, float)
+REGISTER_STAT(HEALING_ORB_ALPHA, float)
+REGISTER_STAT(PLASMA, int)
+REGISTER_STAT(OK_AMMO_CHARGE, float)
+REGISTER_STAT(OK_AMMO_CHARGEPOOL, float)
+REGISTER_STAT(FROZEN, int)
+REGISTER_STAT(REVIVE_PROGRESS, float)
+REGISTER_STAT(ROUNDLOST, int)
+REGISTER_STAT(BUFF_TIME, float)
+REGISTER_STAT(CTF_FLAGSTATUS, int)
+
+#ifdef SVQC
+int autocvar_g_multijump;
+float autocvar_g_multijump_add;
+float autocvar_g_multijump_speed;
+float autocvar_g_multijump_maxspeed;
+float autocvar_g_multijump_dodging = 1;
+#endif
+REGISTER_STAT(MULTIJUMP_DODGING, int, autocvar_g_multijump_dodging)
+REGISTER_STAT(MULTIJUMP_MAXSPEED, float, autocvar_g_multijump_maxspeed)
+REGISTER_STAT(MULTIJUMP_ADD, int, autocvar_g_multijump_add)
+REGISTER_STAT(MULTIJUMP_SPEED, float, autocvar_g_multijump_speed)
+.int multijump_count;
+REGISTER_STAT(MULTIJUMP_COUNT, int, this.multijump_count)
+REGISTER_STAT(MULTIJUMP, int, autocvar_g_multijump)
+REGISTER_STAT(DOUBLEJUMP, int, autocvar_sv_doublejump)
+
+#ifdef SVQC
+bool g_bugrigs;
+bool g_bugrigs_planar_movement;
+bool g_bugrigs_planar_movement_car_jumping;
+float g_bugrigs_reverse_spinning;
+float g_bugrigs_reverse_speeding;
+float g_bugrigs_reverse_stopping;
+float g_bugrigs_air_steering;
+float g_bugrigs_angle_smoothing;
+float g_bugrigs_friction_floor;
+float g_bugrigs_friction_brake;
+float g_bugrigs_friction_air;
+float g_bugrigs_accel;
+float g_bugrigs_speed_ref;
+float g_bugrigs_speed_pow;
+float g_bugrigs_steer;
+#endif
+REGISTER_STAT(BUGRIGS, int, g_bugrigs)
+REGISTER_STAT(BUGRIGS_ACCEL, float, g_bugrigs_accel)
+REGISTER_STAT(BUGRIGS_AIR_STEERING, int, g_bugrigs_air_steering)
+REGISTER_STAT(BUGRIGS_ANGLE_SMOOTHING, int, g_bugrigs_angle_smoothing)
+REGISTER_STAT(BUGRIGS_CAR_JUMPING, int, g_bugrigs_planar_movement_car_jumping)
+REGISTER_STAT(BUGRIGS_FRICTION_AIR, float, g_bugrigs_friction_air)
+REGISTER_STAT(BUGRIGS_FRICTION_BRAKE, float, g_bugrigs_friction_brake)
+REGISTER_STAT(BUGRIGS_FRICTION_FLOOR, float, g_bugrigs_friction_floor)
+REGISTER_STAT(BUGRIGS_PLANAR_MOVEMENT, int, g_bugrigs_planar_movement)
+REGISTER_STAT(BUGRIGS_REVERSE_SPEEDING, int, g_bugrigs_reverse_speeding)
+REGISTER_STAT(BUGRIGS_REVERSE_SPINNING, int, g_bugrigs_reverse_spinning)
+REGISTER_STAT(BUGRIGS_REVERSE_STOPPING, int, g_bugrigs_reverse_stopping)
+REGISTER_STAT(BUGRIGS_SPEED_POW, float, g_bugrigs_speed_pow)
+REGISTER_STAT(BUGRIGS_SPEED_REF, float, g_bugrigs_speed_ref)
+REGISTER_STAT(BUGRIGS_STEER, float, g_bugrigs_steer)
+
+REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int, cvar("sv_gameplayfix_downtracesupportsongroundflag"))
+REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int, cvar("sv_gameplayfix_easierwaterjump"))
+REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int, cvar("sv_gameplayfix_stepdown"))
+REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int, cvar("sv_gameplayfix_stepmultipletimes"))
+REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int, cvar("sv_gameplayfix_unstickplayers"))
+REGISTER_STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, int, autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag)
+
+REGISTER_STAT(MOVEVARS_JUMPSTEP, int, cvar("sv_jumpstep"))
+REGISTER_STAT(NOSTEP, int, cvar("sv_nostep"))
+
+REGISTER_STAT(MOVEVARS_FRICTION, float)
+REGISTER_STAT(MOVEVARS_FRICTION_SLICK, float, autocvar_sv_friction_slick)
+REGISTER_STAT(MOVEVARS_FRICTION_ONLAND, float, autocvar_sv_friction_on_land)
+
+REGISTER_STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, int, autocvar_sv_jumpspeedcap_max_disable_on_ramps)
+REGISTER_STAT(MOVEVARS_TRACK_CANJUMP, int)
+/** cvar loopback */
+REGISTER_STAT(MOVEVARS_CL_TRACK_CANJUMP, int)
+
+#ifdef SVQC
+int g_dodging;
+float autocvar_sv_dodging_delay;
+float autocvar_sv_dodging_wall_distance_threshold;
+bool autocvar_sv_dodging_frozen;
+bool autocvar_sv_dodging_frozen_doubletap;
+float autocvar_sv_dodging_height_threshold;
+float autocvar_sv_dodging_horiz_speed;
+float autocvar_sv_dodging_horiz_speed_frozen;
+float autocvar_sv_dodging_ramp_time;
+float autocvar_sv_dodging_up_speed;
+bool autocvar_sv_dodging_wall_dodging;
+#endif
+
+REGISTER_STAT(DODGING, int, g_dodging)
+REGISTER_STAT(DODGING_DELAY, float, autocvar_sv_dodging_delay)
+REGISTER_STAT(DODGING_DISTANCE_THRESHOLD, float, autocvar_sv_dodging_wall_distance_threshold)
+REGISTER_STAT(DODGING_FROZEN, int, autocvar_sv_dodging_frozen)
+REGISTER_STAT(DODGING_FROZEN_NO_DOUBLETAP, int, autocvar_sv_dodging_frozen_doubletap)
+REGISTER_STAT(DODGING_HEIGHT_THRESHOLD, float, autocvar_sv_dodging_height_threshold)
+REGISTER_STAT(DODGING_HORIZ_SPEED, float, autocvar_sv_dodging_horiz_speed)
+REGISTER_STAT(DODGING_HORIZ_SPEED_FROZEN, float, autocvar_sv_dodging_horiz_speed_frozen)
+REGISTER_STAT(DODGING_RAMP_TIME, float, autocvar_sv_dodging_ramp_time)
+/** cvar loopback */
+REGISTER_STAT(DODGING_TIMEOUT, float)
+REGISTER_STAT(DODGING_UP_SPEED, float, autocvar_sv_dodging_up_speed)
+REGISTER_STAT(DODGING_WALL, int, autocvar_sv_dodging_wall_dodging)
+
+REGISTER_STAT(JETPACK_ACCEL_SIDE, float, autocvar_g_jetpack_acceleration_side)
+REGISTER_STAT(JETPACK_ACCEL_UP, float, autocvar_g_jetpack_acceleration_up)
+REGISTER_STAT(JETPACK_ANTIGRAVITY, float, autocvar_g_jetpack_antigravity)
+REGISTER_STAT(JETPACK_FUEL, float, autocvar_g_jetpack_fuel)
+REGISTER_STAT(JETPACK_MAXSPEED_SIDE, float, autocvar_g_jetpack_maxspeed_side)
+REGISTER_STAT(JETPACK_MAXSPEED_UP, float, autocvar_g_jetpack_maxspeed_up)
 
-/* The following stats change depending on the gamemode, so can share the same ID */
-// IDs 100 to 104 reserved for gamemodes
+REGISTER_STAT(MOVEVARS_HIGHSPEED, float, autocvar_g_movement_highspeed)
 
-// freeze tag, clan arena, jailbreak
-const int STAT_REDALIVE               = 100;
-const int STAT_BLUEALIVE              = 101;
-const int STAT_YELLOWALIVE            = 102;
-const int STAT_PINKALIVE              = 103;
+// freeze tag, clan arena
+REGISTER_STAT(REDALIVE, int)
+REGISTER_STAT(BLUEALIVE, int)
+REGISTER_STAT(YELLOWALIVE, int)
+REGISTER_STAT(PINKALIVE, int)
 
 // domination
-const int STAT_DOM_TOTAL_PPS          = 100;
-const int STAT_DOM_PPS_RED            = 101;
-const int STAT_DOM_PPS_BLUE           = 102;
-const int STAT_DOM_PPS_YELLOW         = 103;
-const int STAT_DOM_PPS_PINK           = 104;
+REGISTER_STAT(DOM_TOTAL_PPS, float)
+REGISTER_STAT(DOM_PPS_RED, float)
+REGISTER_STAT(DOM_PPS_BLUE, float)
+REGISTER_STAT(DOM_PPS_YELLOW, float)
+REGISTER_STAT(DOM_PPS_PINK, float)
 
-// vip
-const int STAT_VIP                    = 100;
-const int STAT_VIP_RED                = 101;
-const int STAT_VIP_BLUE               = 102;
-const int STAT_VIP_YELLOW             = 103;
-const int STAT_VIP_PINK               = 104;
+REGISTER_STAT(TELEPORT_MAXSPEED, float, autocvar_g_teleport_maxspeed)
+REGISTER_STAT(TELEPORT_TELEFRAG_AVOID, int, autocvar_g_telefrags_avoid)
 
-// key hunt
-const int STAT_KH_REDKEY_TEAM         = 100;
-const int STAT_KH_BLUEKEY_TEAM        = 101;
-const int STAT_KH_YELLOWKEY_TEAM      = 102;
-const int STAT_KH_PINKKEY_TEAM        = 103;
+#ifdef SVQC
+#include "movetypes/movetypes.qh"
+#endif
+
+REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
+REGISTER_STAT(MOVEVARS_AIRCONTROL_PENALTY, float)
+REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float)
+REGISTER_STAT(MOVEVARS_AIRSTRAFEACCEL_QW, float)
+REGISTER_STAT(MOVEVARS_AIRCONTROL_POWER, float)
+noref bool autocvar_sv_gameplayfix_nogravityonground;
+REGISTER_STAT(MOVEFLAGS, int, MOVEFLAG_VALID
+                              | (autocvar_sv_gameplayfix_q2airaccelerate ? MOVEFLAG_Q2AIRACCELERATE : 0)
+                              | (autocvar_sv_gameplayfix_nogravityonground ? MOVEFLAG_NOGRAVITYONGROUND : 0)
+                              | (autocvar_sv_gameplayfix_gravityunaffectedbyticrate ? MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE : 0))
 
-/* Gamemode-specific stats end here */
+REGISTER_STAT(MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL, float)
+REGISTER_STAT(MOVEVARS_WARSOWBUNNY_ACCEL, float)
+REGISTER_STAT(MOVEVARS_WARSOWBUNNY_TOPSPEED, float)
+REGISTER_STAT(MOVEVARS_WARSOWBUNNY_TURNACCEL, float)
+REGISTER_STAT(MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO, float)
 
-const int STAT_PL_VIEW_OFS1           = 105;
-const int STAT_PL_VIEW_OFS2           = 106;
-const int STAT_PL_VIEW_OFS3           = 107;
-const int STAT_PL_MIN1                = 108;
-const int STAT_PL_MIN2                = 109;
-const int STAT_PL_MIN3                = 110;
-const int STAT_PL_MAX1                = 111;
-const int STAT_PL_MAX2                = 112;
-const int STAT_PL_MAX3                = 113;
-const int STAT_PL_CROUCH_MIN1         = 114;
-const int STAT_PL_CROUCH_MIN2         = 115;
-const int STAT_PL_CROUCH_MIN3         = 116;
-const int STAT_PL_CROUCH_MAX1         = 117;
-const int STAT_PL_CROUCH_MAX2         = 118;
-const int STAT_PL_CROUCH_MAX3         = 119;
-const int STAT_PL_CROUCH_VIEW_OFS1    = 117;
-const int STAT_PL_CROUCH_VIEW_OFS2    = 118;
-const int STAT_PL_CROUCH_VIEW_OFS3    = 119;
-const int STAT_WEAPONSINMAP           = 120;
-const int STAT_WEAPONSINMAP2          = 121;
-const int STAT_WEAPONSINMAP3          = 122;
-const int STAT_BUFF_TIME              = 123;
-const int STAT_CTF_FLAGSTATUS         = 124;
-// 125 empty?
-// 126 empty?
-// 127 empty?
-// 128 empty?
-// 129 empty?
-// 130 empty?
-// 131 empty?
-// 132 empty?
-// 133 empty?
-// 134 empty?
-// 135 empty?
-// 136 empty?
-// 137 empty?
-// 138 empty?
-// 139 empty?
-// 140 reserved
-// 141 reserved
-// 142 reserved
-// 143 reserved
-// 144 reserved
-// 145 reserved
-// 146 reserved
-// 147 reserved
-// 148 reserved
-// 149 reserved
-// 150 reserved
-// 151 reserved
-// 152 reserved
-// 153 reserved
-// 154 reserved
-// 155 reserved
-// 156 empty?
-// 157 empty?
-// 158 empty?
-// 159 empty?
-// 160 empty?
-// 161 empty?
-// 162 empty?
-// 162 empty?
-// 163 empty?
-// 164 empty?
-// 165 empty?
-const int STAT_MULTIJUMP_DODGING                      = 166;
-const int STAT_MULTIJUMP_MAXSPEED                     = 167;
-const int STAT_GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND   = 168;
-const int STAT_BUGRIGS_REVERSE_STOPPING               = 169;
-const int STAT_BUGRIGS_REVERSE_SPINNING               = 170;
-const int STAT_BUGRIGS_CAR_JUMPING                    = 171;
-const int STAT_BUGRIGS_FRICTION_AIR                   = 172;
-const int STAT_BUGRIGS_STEER                          = 173;
-const int STAT_BUGRIGS_SPEED_POW                      = 174;
-const int STAT_BUGRIGS_SPEED_REF                      = 175;
-const int STAT_BUGRIGS_ACCEL                          = 176;
-const int STAT_BUGRIGS_FRICTION_BRAKE                 = 177;
-const int STAT_BUGRIGS_AIR_STEERING                   = 178;
-const int STAT_BUGRIGS_FRICTION_FLOOR                 = 179;
-const int STAT_BUGRIGS_REVERSE_SPEEDING               = 180;
-const int STAT_BUGRIGS_PLANAR_MOVEMENT                = 181;
-const int STAT_BUGRIGS_ANGLE_SMOOTHING                = 182;
-const int STAT_BUGRIGS                                = 183;
-const int STAT_GAMEPLAYFIX_STEPDOWN                   = 184;
-const int STAT_MOVEVARS_JUMPSTEP                      = 185;
-const int STAT_NOSTEP                                 = 186;
-const int STAT_GAMEPLAYFIX_UNSTICKPLAYERS             = 187;
-const int STAT_GAMEPLAYFIX_STEPMULTIPLETIMES          = 188;
-const int STAT_GAMEPLAYFIX_DOWNTRACEONGROUND          = 189;
-const int STAT_GAMEPLAYFIX_EASIERWATERJUMP            = 190;
-const int STAT_MOVEVARS_FRICTION_SLICK                = 191;
-const int STAT_MOVEVARS_FRICTION_ONLAND               = 192;
-const int STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS  = 193;
-const int STAT_MOVEVARS_TRACK_CANJUMP                 = 194;
-// 195 empty?
-const int STAT_DOUBLEJUMP                             = 196;
-const int STAT_MOVEVARS_CL_TRACK_CANJUMP              = 197;
-const int STAT_MULTIJUMP_ADD                          = 198;
-const int STAT_MULTIJUMP_SPEED                        = 199;
-const int STAT_MULTIJUMP                              = 200;
-const int STAT_DODGING_TIMEOUT                        = 201;
-const int STAT_DODGING_WALL                           = 202;
-const int STAT_DODGING_UP_SPEED                       = 203;
-const int STAT_DODGING_RAMP_TIME                      = 204;
-const int STAT_DODGING_HEIGHT_THRESHOLD               = 205;
-const int STAT_DODGING_DISTANCE_THRESHOLD             = 206;
-const int STAT_DODGING_HORIZ_SPEED                    = 207;
-const int STAT_DODGING_DELAY                          = 208;
-const int STAT_DODGING_FROZEN_NO_DOUBLETAP            = 209;
-const int STAT_DODGING_HORIZ_SPEED_FROZEN             = 210;
-const int STAT_DODGING                                = 211;
-const int STAT_DODGING_FROZEN                         = 212;
-const int STAT_JETPACK_MAXSPEED_UP                    = 213;
-const int STAT_JETPACK_MAXSPEED_SIDE                  = 214;
-const int STAT_JETPACK_FUEL                           = 215;
-const int STAT_JETPACK_ANTIGRAVITY                    = 216;
-const int STAT_JETPACK_ACCEL_SIDE                     = 217;
-const int STAT_JETPACK_ACCEL_UP                       = 218;
-const int STAT_MOVEVARS_HIGHSPEED                     = 219;
-const int STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR     = 220;
-const int STAT_MOVEVARS_AIRCONTROL_PENALTY            = 221;
-const int STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW           = 222;
-const int STAT_MOVEVARS_AIRSTRAFEACCEL_QW             = 223;
-const int STAT_MOVEVARS_AIRCONTROL_POWER              = 224;
-const int STAT_MOVEFLAGS                              = 225;
-const int STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL   = 226;
-const int STAT_MOVEVARS_WARSOWBUNNY_ACCEL             = 227;
-const int STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED          = 228;
-const int STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL         = 229;
-const int STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO   = 230;
-const int STAT_MOVEVARS_AIRSTOPACCELERATE             = 231;
-const int STAT_MOVEVARS_AIRSTRAFEACCELERATE           = 232;
-const int STAT_MOVEVARS_MAXAIRSTRAFESPEED             = 233;
-const int STAT_MOVEVARS_AIRCONTROL                    = 234;
-// -Wdouble-declaration
-// const int STAT_FRAGLIMIT                              = 235;
-// -Wdouble-declaration
-// const int STAT_TIMELIMIT                              = 236;
-const int STAT_MOVEVARS_WALLFRICTION                  = 237;
-const int STAT_MOVEVARS_FRICTION                      = 238;
-const int STAT_MOVEVARS_WATERFRICTION                 = 239;
-// -Wdouble-declaration
-// const int STAT_MOVEVARS_TICRATE                       = 240;
-// -Wdouble-declaration
-// const int STAT_MOVEVARS_TIMESCALE                     = 241;
-// -Wdouble-declaration
-// const int STAT_MOVEVARS_GRAVITY                       = 242;
-const int STAT_MOVEVARS_STOPSPEED                     = 243;
-const int STAT_MOVEVARS_MAXSPEED                      = 244;
-const int STAT_MOVEVARS_SPECTATORMAXSPEED             = 245;
-const int STAT_MOVEVARS_ACCELERATE                    = 246;
-const int STAT_MOVEVARS_AIRACCELERATE                 = 247;
-const int STAT_MOVEVARS_WATERACCELERATE               = 248;
-const int STAT_MOVEVARS_ENTGRAVITY                    = 249;
-const int STAT_MOVEVARS_JUMPVELOCITY                  = 250;
-const int STAT_MOVEVARS_EDGEFRICTION                  = 251;
-const int STAT_MOVEVARS_MAXAIRSPEED                   = 252;
-const int STAT_MOVEVARS_STEPHEIGHT                    = 253;
-const int STAT_MOVEVARS_AIRACCEL_QW                   = 254;
-const int STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION    = 255;
+REGISTER_STAT(MOVEVARS_AIRSTOPACCELERATE, float)
+REGISTER_STAT(MOVEVARS_AIRSTRAFEACCELERATE, float)
+REGISTER_STAT(MOVEVARS_MAXAIRSTRAFESPEED, float)
+REGISTER_STAT(MOVEVARS_AIRCONTROL, float)
+REGISTER_STAT(FRAGLIMIT, float, autocvar_fraglimit)
+REGISTER_STAT(TIMELIMIT, float, autocvar_timelimit)
+#ifdef SVQC
+float autocvar_sv_wallfriction;
+#endif
+REGISTER_STAT(MOVEVARS_WALLFRICTION, int, autocvar_sv_wallfriction)
+REGISTER_STAT(MOVEVARS_TICRATE, float, autocvar_sys_ticrate)
+REGISTER_STAT(MOVEVARS_TIMESCALE, float, autocvar_slowmo)
+REGISTER_STAT(MOVEVARS_GRAVITY, float, autocvar_sv_gravity)
+REGISTER_STAT(MOVEVARS_STOPSPEED, float)
+REGISTER_STAT(MOVEVARS_MAXSPEED, float)
+REGISTER_STAT(MOVEVARS_ACCELERATE, float)
+REGISTER_STAT(MOVEVARS_AIRACCELERATE, float)
+.float gravity;
+// FIXME: Was 0 on server, 1 on client. Still want that?
+REGISTER_STAT(MOVEVARS_ENTGRAVITY, float, (this.gravity) ? this.gravity : 1)
+REGISTER_STAT(MOVEVARS_JUMPVELOCITY, float)
+REGISTER_STAT(MOVEVARS_MAXAIRSPEED, float)
+REGISTER_STAT(MOVEVARS_STEPHEIGHT, float, autocvar_sv_stepheight)
+REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float)
+REGISTER_STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, float)
 #endif