]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port shotorg stat
authorMario <mario@smbclan.net>
Sat, 14 Nov 2015 12:52:52 +0000 (22:52 +1000)
committerMario <mario@smbclan.net>
Sat, 14 Nov 2015 12:52:52 +0000 (22:52 +1000)
qcsrc/client/view.qc
qcsrc/common/stats.qh
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index c319dfcf0bdbc339d011fe6edb13ad2958cf9d5d..7b24b9fb6d886c44a677fe6449b490c79ace4adb 100644 (file)
@@ -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;
index 3edaa36f35d42c406806ffb3ed2f6c6528a6583d..8aed9b75c99fa83cb445aa2918b5321def10b90c 100644 (file)
@@ -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,
index 90cb409a888976cb7f5e0e9a3cd0b1d85a980308..2d747cd59e5affb0f92d47c245e7909ff86c795b 100644 (file)
@@ -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;
 
index 202ed1190fc5e7cb19ed4a72dff1ceab64d2a85b..84f1464b175453af615688a869ea093d7211498e 100644 (file)
@@ -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);