#define STATS_H
#ifdef SVQC
-#include "../server/cl_client.qh"
+#include <server/cl_client.qh>
#endif
// 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;
-#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
+
+// const int STAT_HEALTH = 0;
+// const int STAT_ARMOR = 4;
+// const int STAT_SHELLS = 6;
+// const int STAT_NAILS = 7;
+// const int STAT_ROCKETS = 8;
+// const int STAT_CELLS = 9;
+// const int STAT_ACTIVEWEAPON = 10;
+// const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28
+// const int STAT_VIEWHEIGHT = 16;
+
+#if defined(CSQC)
+ #define g_stat_HEALTH getstati(STAT_HEALTH)
+ #define g_stat_ARMOR getstat_int(STAT_ARMOR)
+ #define g_stat_SHELLS getstat_int(STAT_SHELLS)
+ #define g_stat_NAILS getstat_int(STAT_NAILS)
+ #define g_stat_ROCKETS getstat_int(STAT_ROCKETS)
+ #define g_stat_CELLS getstat_int(STAT_CELLS)
+ #define g_stat_ACTIVEWEAPON getstat_int(STAT_ACTIVEWEAPON)
+ #define g_stat_ITEMS getstat_int(STAT_ITEMS)
+ #define g_stat_VIEWHEIGHT getstati(STAT_VIEWHEIGHT)
+#elif defined(SVQC)
+ #define stat_HEALTH health
+ #define stat_ARMOR armorvalue
+ #define stat_SHELLS ammo_shells
+ #define stat_NAILS ammo_nails
+ #define stat_ROCKETS ammo_rockets
+ #define stat_CELLS ammo_cells
+ #define stat_ACTIVEWEAPON weapon
+ #define stat_ITEMS items
+ #define stat_VIEWHEIGHT view_ofs_z
#endif
REGISTER_STAT(WEAPONS, vectori)
REGISTER_STAT(SWITCHINGWEAPON, int)
REGISTER_STAT(WEAPON_NEXTTHINK, float)
#ifdef SVQC
-SPECTATE_COPY(_STAT(WEAPON_NEXTTHINK))
+SPECTATE_COPYFIELD(_STAT(WEAPON_NEXTTHINK))
float W_WeaponRateFactor();
#endif
REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor())
REGISTER_STAT(TELEPORT_MAXSPEED, float, autocvar_g_teleport_maxspeed)
REGISTER_STAT(TELEPORT_TELEFRAG_AVOID, int, autocvar_g_telefrags_avoid)
+REGISTER_STAT(SPECTATORSPEED, float)
+
#ifdef SVQC
-#include "movetypes/movetypes.qh"
+#include "physics/movetypes/movetypes.qh"
#endif
REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
REGISTER_STAT(MOVEVARS_AIRCONTROL, float)
REGISTER_STAT(FRAGLIMIT, float, autocvar_fraglimit)
REGISTER_STAT(TIMELIMIT, float, autocvar_timelimit)
+REGISTER_STAT(WARMUP_TIMELIMIT, float, warmup_limit)
#ifdef SVQC
float autocvar_sv_wallfriction;
#endif
REGISTER_STAT(MOVEVARS_STEPHEIGHT, float, autocvar_sv_stepheight)
REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float)
REGISTER_STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, float)
+
+
+#ifdef CSQC
+noref int autocvar_cl_gunalign;
+#endif
+#ifdef SVQC
+.int cvar_cl_gunalign;
+REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
+#endif
+REGISTER_STAT(GUNALIGN, int, this.cvar_cl_gunalign)
+#ifdef SVQC
+SPECTATE_COPYFIELD(_STAT(GUNALIGN))
+#endif
+
+
#endif