From: Mario Date: Sun, 16 Jul 2017 23:12:01 +0000 (+1000) Subject: Make some global stats global and fix a warning when spectating X-Git-Tag: xonotic-v0.8.5~2583 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d402108323d5d2a0073b1351a80791eb9fee478;p=xonotic%2Fxonotic-data.pk3dir.git Make some global stats global and fix a warning when spectating --- diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 2cb353361..bfed4390d 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -41,8 +41,11 @@ const int MAX_CL_STATS = 256; #define stat_VIEWHEIGHT view_ofs_z #endif +#ifdef SVQC +vector weaponsInMap; +#endif REGISTER_STAT(WEAPONS, vectori) -REGISTER_STAT(WEAPONSINMAP, vectori) +REGISTER_STAT(WEAPONSINMAP, vectori, weaponsInMap) REGISTER_STAT(PL_VIEW_OFS, vector) REGISTER_STAT(PL_CROUCH_VIEW_OFS, vector) @@ -58,22 +61,26 @@ REGISTER_STAT(KH_KEYS, int) #ifdef SVQC float W_WeaponRateFactor(entity this); float game_stopped; +float game_starttime; +float round_starttime; +bool autocvar_g_allow_oldvortexbeam; +int autocvar_leadlimit; #endif REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) REGISTER_STAT(GAME_STOPPED, int, game_stopped) -REGISTER_STAT(GAMESTARTTIME, float) +REGISTER_STAT(GAMESTARTTIME, float, game_starttime) 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(ALLOW_OLDVORTEXBEAM, bool, autocvar_g_allow_oldvortexbeam) REGISTER_STAT(FUEL, int) REGISTER_STAT(NB_METERSTART, float) /** compressShotOrigin */ REGISTER_STAT(SHOTORG, int) -REGISTER_STAT(LEADLIMIT, float) +REGISTER_STAT(LEADLIMIT, float, autocvar_leadlimit) REGISTER_STAT(WEAPON_CLIPLOAD, int) REGISTER_STAT(WEAPON_CLIPSIZE, int) @@ -99,7 +106,7 @@ 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(ROUNDSTARTTIME, float, round_starttime) REGISTER_STAT(MONSTERS_TOTAL, int) REGISTER_STAT(MONSTERS_KILLED, int) REGISTER_STAT(BUFFS, int) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 0c2c1ed4f..f585a9a2c 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -13,7 +13,7 @@ int autocvar_captureleadlimit_override; float autocvar_ekg; #define autocvar_fraglimit cvar("fraglimit") #define autocvar_fraglimit_override cvar("fraglimit_override") -bool autocvar_g_allow_oldvortexbeam; +//bool autocvar_g_allow_oldvortexbeam; int autocvar_g_antilag; float autocvar_g_antilag_nudge; float autocvar_g_balance_armor_blockpercent; @@ -258,7 +258,7 @@ float autocvar_gameversion_min; float autocvar_gameversion_max; string autocvar_hostname; bool autocvar_lastlevel; -int autocvar_leadlimit; +//int autocvar_leadlimit; int autocvar_leadlimit_and_fraglimit; int autocvar_leadlimit_override; int autocvar_loddebug; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 5e4fa38a7..635bed7cf 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -334,7 +334,6 @@ void PutObserverInServer(entity this) this.items = 0; this.weapons = '0 0 0'; - PS(this).dual_weapons = '0 0 0'; this.drawonlytoclient = this; this.weaponmodel = ""; @@ -2443,13 +2442,6 @@ void PlayerPreThink (entity this) { WarpZone_PlayerPhysics_FixVAngle(this); - STAT(GAMESTARTTIME, this) = game_starttime; - STAT(ROUNDSTARTTIME, this) = round_starttime; - STAT(ALLOW_OLDVORTEXBEAM, this) = autocvar_g_allow_oldvortexbeam; - STAT(LEADLIMIT, this) = autocvar_leadlimit; - - STAT(WEAPONSINMAP, this) = weaponsInMap; - if (frametime) { // physics frames: update anticheat stuff anticheat_prethink(this); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index f4d78b0e8..a18e54d2a 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -186,7 +186,7 @@ void FixIntermissionClient(entity e); void FixClientCvars(entity e); // WEAPONTODO: remove this -WepSet weaponsInMap; +//WepSet weaponsInMap; #define weapons _STAT(WEAPONS) @@ -256,8 +256,8 @@ string cvar_changes; string cvar_purechanges; float cvar_purechanges_count; -float game_starttime; //point in time when the countdown to game start is over -float round_starttime; //point in time when the countdown to round start is over +//float game_starttime; //point in time when the countdown to game start is over +//float round_starttime; //point in time when the countdown to round start is over void W_Porto_Remove (entity p);