From: Mario Date: Sat, 14 Nov 2015 13:05:51 +0000 (+1000) Subject: Port clipload and clipsize X-Git-Tag: xonotic-v0.8.2~1609^2~14 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5b96027d6d67bb150cb2b8b10680ec775f049fc7;p=xonotic%2Fxonotic-data.pk3dir.git Port clipload and clipsize --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 7b24b9fb6..8fdefe0ec 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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); diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 1f5f89fd0..5e29b2f9d 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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, diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 2ed37abf4..eb40628ef 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 810da9c50..e7a079a57 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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);