]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port clip_load and clip_size to wepent 532/head
authorMario <mario@smbclan.net>
Tue, 13 Feb 2018 00:30:13 +0000 (10:30 +1000)
committerMario <mario@smbclan.net>
Tue, 13 Feb 2018 00:30:13 +0000 (10:30 +1000)
qcsrc/client/view.qc
qcsrc/common/stats.qh
qcsrc/common/wepent.qc
qcsrc/common/wepent.qh
qcsrc/server/client.qc
qcsrc/server/defs.qh

index cf7ca8087f4cea03f6f74c945c90b12cb6c789b2..7dcbd83d2b3c661db795119e6698424a5f4baa40 100644 (file)
@@ -1191,12 +1191,11 @@ void HUD_Crosshair(entity this)
 
                                ring_scale = autocvar_crosshair_ring_size;
 
-                               float weapon_clipload, weapon_clipsize;
-                               weapon_clipload = STAT(WEAPON_CLIPLOAD);
-                               weapon_clipsize = STAT(WEAPON_CLIPSIZE);
-
                                entity wepent = viewmodels[0]; // TODO: unhardcode
 
+                               int weapon_clipload = wepent.clip_load;
+                               int weapon_clipsize = wepent.clip_size;
+
                                float arc_heat = wepent.arc_heat_percent;
                                float vcharge = wepent.vortex_charge;
                                float vchargepool = wepent.vortex_chargepool_ammo;
index e3ff0b3d4b423e6dfc07c9a4fe470b0985b81dc4..69d3a4f583326714cc89f44f23fe2d097f3a993d 100644 (file)
@@ -81,8 +81,6 @@ REGISTER_STAT(NB_METERSTART, float)
 /** compressShotOrigin */
 REGISTER_STAT(SHOTORG, int)
 REGISTER_STAT(LEADLIMIT, float, autocvar_leadlimit)
-REGISTER_STAT(WEAPON_CLIPLOAD, int)
-REGISTER_STAT(WEAPON_CLIPSIZE, int)
 
 REGISTER_STAT(LAST_PICKUP, float)
 REGISTER_STAT(HUD, int)
index 36ab27dfabb438ec8cd65a1c88a8e21abf6da491..9335a4788da1e0c2da70a08391826dab7521fec9 100644 (file)
@@ -57,6 +57,14 @@ MACRO_END
     PROP(false, vortex_chargepool_ammo, WEPENT_SET_NORMAL, \
        { WriteByte(chan, this.vortex_chargepool_ammo * 16); }, \
        { (viewmodels[this.m_wepent_slot]).vortex_chargepool_ammo = ReadByte() / 16; }) \
+    \
+    PROP(false, clip_load, WEPENT_SET_NORMAL, \
+       { WriteShort(chan, this.clip_load); }, \
+       { (viewmodels[this.m_wepent_slot]).clip_load = ReadShort(); }) \
+    \
+    PROP(false, clip_size, WEPENT_SET_NORMAL, \
+       { WriteShort(chan, this.clip_size); }, \
+       { (viewmodels[this.m_wepent_slot]).clip_size = ReadShort(); }) \
     \
        /**/
 
index ad2bba02e19a33de8648daf2e65a646fa37d6dd5..dbd38fc10f8916510d0ef3c37c624c0c4ef533c4 100644 (file)
@@ -9,6 +9,8 @@ REGISTER_NET_TEMP(CLIENT_WEPENT)
 .int minelayer_mines;
 .float arc_heat_percent;
 .int hagar_load;
+.int clip_load;
+.int clip_size;
 
 #ifdef SVQC
 
index 7dc26025e4e2387cc47e40b946a8dacdca7ad6ad..38869cea42e0abe936995b42ee33cee1aef98acb 100644 (file)
@@ -1763,8 +1763,6 @@ void SpectateCopy(entity this, entity spectatee)
        this.ammo_nails = spectatee.ammo_nails;
        this.ammo_rockets = spectatee.ammo_rockets;
        this.ammo_fuel = spectatee.ammo_fuel;
-       this.clip_load = spectatee.clip_load;
-       this.clip_size = spectatee.clip_size;
        this.effects = spectatee.effects & EFMASK_CHEAP; // eat performance
        this.health = spectatee.health;
        CS(this).impulse = 0;
@@ -2289,12 +2287,6 @@ bool PlayerThink(entity this)
                {
                        .entity weaponentity = weaponentities[slot];
                        W_WeaponFrame(this, weaponentity);
-
-                       if(slot == 0)
-                       {
-                               this.clip_load = this.(weaponentity).clip_load;
-                               this.clip_size = this.(weaponentity).clip_size;
-                       }
                }
 
                this.items_added = 0;
index 52f269845aaae49202e7b0a9c796c7a8c6ff8dce..577753a509a9369ffbce77fb7ae751c6651cd8d6 100644 (file)
@@ -324,9 +324,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 = _STAT(WEAPON_CLIPLOAD);
+.float clip_load;
 .float old_clip_load;
-.float clip_size = _STAT(WEAPON_CLIPSIZE);
+.float clip_size;
 
 .int minelayer_mines;
 .float vortex_charge;