From c6f4cf9a973f490bc48d6c8f2fc7726653a45877 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 14 Nov 2015 22:52:52 +1000 Subject: [PATCH] Port shotorg stat --- qcsrc/client/view.qc | 2 +- qcsrc/common/stats.qh | 5 +++-- qcsrc/server/defs.qh | 2 +- qcsrc/server/g_world.qc | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index c319dfcf0..7b24b9fb6 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -362,7 +362,7 @@ float TrueAimCheck() vector traceorigin = getplayerorigin(player_localentnum-1) + (eZ * getstati(STAT_VIEWHEIGHT)); - vecs = decompressShotOrigin(getstati(STAT_SHOTORG)); + vecs = decompressShotOrigin(STAT(SHOTORG)); traceline(traceorigin, traceorigin + view_forward * MAX_SHOT_DISTANCE, mv, ta); trueaimpoint = trace_endpos; diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 3edaa36f3..8aed9b75c 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -89,7 +89,7 @@ enum { STAT_LAST_VECTOR }; -const int REGISTERED_STATS = 10; +const int REGISTERED_STATS = 11; REGISTER_STAT(KH_KEYS, int) /** weapon requested to switch to; next WANTED weapon (for HUD) */ @@ -104,11 +104,12 @@ REGISTER_STAT(PRESSED_KEYS, int) REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool) REGISTER_STAT(FUEL, int) REGISTER_STAT(NB_METERSTART, float) +/** compressShotOrigin */ +REGISTER_STAT(SHOTORG, int) enum { STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS, - /** compressShotOrigin */ STAT_SHOTORG, STAT_LEADLIMIT, STAT_WEAPON_CLIPLOAD, STAT_WEAPON_CLIPSIZE, diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 90cb409a8..2d747cd59 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -443,7 +443,7 @@ float servertime, serverprevtime, serverframetime; .float floodcontrol_voice; .float floodcontrol_voiceteam; -.float stat_shotorg; // networked stat for trueaim HUD +.float stat_shotorg = _STAT(SHOTORG); // networked stat for trueaim HUD string matchid; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 202ed1190..84f1464b1 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -763,7 +763,6 @@ spawnfunc(worldspawn) addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished); addstat(STAT_PLASMA, AS_INT, ammo_plasma); - addstat(STAT_SHOTORG, AS_INT, stat_shotorg); addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit); addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load); addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size); -- 2.39.2