]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port clipload and clipsize
authorMario <mario@smbclan.net>
Sat, 14 Nov 2015 13:05:51 +0000 (23:05 +1000)
committerMario <mario@smbclan.net>
Sat, 14 Nov 2015 13:05:51 +0000 (23:05 +1000)
qcsrc/client/view.qc
qcsrc/common/stats.qh
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index 7b24b9fb6d886c44a677fe6449b490c79ace4adb..8fdefe0ec0180132db0dfcae392e469240c102e6 100644 (file)
@@ -819,8 +819,8 @@ void HUD_Crosshair()
                                ring_scale = autocvar_crosshair_ring_size;
 
                                float weapon_clipload, weapon_clipsize;
-                               weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);
-                               weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);
+                               weapon_clipload = STAT(WEAPON_CLIPLOAD);
+                               weapon_clipsize = STAT(WEAPON_CLIPSIZE);
 
                                float ok_ammo_charge, ok_ammo_chargepool;
                                ok_ammo_charge = getstatf(STAT_OK_AMMO_CHARGE);
index 1f5f89fd0cdfc8cb44dbb0d75bc3b3f2508565a7..5e29b2f9d99e807bf01a61bd7731044a8e9a1e31 100644 (file)
@@ -89,7 +89,7 @@ enum {
     STAT_LAST_VECTOR
 };
 
-const int REGISTERED_STATS = 12;
+const int REGISTERED_STATS = 14;
 
 REGISTER_STAT(KH_KEYS, int)
 /** weapon requested to switch to; next WANTED weapon (for HUD) */
@@ -107,12 +107,12 @@ REGISTER_STAT(NB_METERSTART, float)
 /** compressShotOrigin */
 REGISTER_STAT(SHOTORG, int)
 REGISTER_STAT(LEADLIMIT, float)
+REGISTER_STAT(WEAPON_CLIPLOAD, int)
+REGISTER_STAT(WEAPON_CLIPSIZE, int)
 
 enum {
     STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
 
-    STAT_WEAPON_CLIPLOAD,
-    STAT_WEAPON_CLIPSIZE,
     STAT_VORTEX_CHARGE,
     STAT_LAST_PICKUP,
     STAT_HUD,
index 2ed37abf4bf6adfd81edf2449fc663cb238cf4c2..eb40628ef51d625458f974a49affe6190b7f2ac3 100644 (file)
@@ -465,9 +465,9 @@ float client_cefc_accumulatortime;
 
 .float weapon_load[Weapons_MAX];
 .int ammo_none; // used by the reloading system, must always be 0
-.float clip_load;
+.float clip_load = _STAT(WEAPON_CLIPLOAD);
 .float old_clip_load;
-.float clip_size;
+.float clip_size = _STAT(WEAPON_CLIPSIZE);
 
 .float minelayer_mines;
 .float vortex_charge;
index 810da9c50b49e2773c384b736a6263f0b473789d..e7a079a57b4b7916e2be00af4e353ea29753ddbe 100644 (file)
@@ -763,8 +763,6 @@ spawnfunc(worldspawn)
 
        addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
        addstat(STAT_PLASMA, AS_INT, ammo_plasma);
-       addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);
-       addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size);
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
        addstat(STAT_HIT_TIME, AS_FLOAT, hit_time);
        addstat(STAT_DAMAGE_DEALT_TOTAL, AS_INT, damage_dealt_total);