]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
Move code that resets clip load whenever the player goes unarmed to the weaposystem
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index 79f692590cb6ae2204a8072d2512d6418b7800e6..9a4392ae3ec7fe668479b9d546b2e9bc3a229632 100644 (file)
@@ -509,6 +509,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                        this.m_switchweapon = WEP_Null;
                        this.state = WS_CLEAR;
                        this.weaponname = "";
+                       this.clip_load = this.clip_size = this.old_clip_load = 0;
                        return;
                }
        }
@@ -521,6 +522,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                this.m_switchingweapon = WEP_Null;
                this.state = WS_CLEAR;
                this.weaponname = "";
+               this.clip_load = this.clip_size = this.old_clip_load = 0;
                return;
        }
 
@@ -602,7 +604,8 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
        {
                if (w != WEP_Null && !(STAT(WEAPONS, actor) & WepSet_FromWeapon(w)))
                {
-                       if (this.m_weapon == this.m_switchweapon) W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
+                       if (this.m_weapon == this.m_switchweapon)
+                               W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                        w = WEP_Null;
                }
 
@@ -658,8 +661,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                                v_right = ri;
                                v_up = up;
                                Weapon wpn = this.m_weapon;
-                               this.weapon_think(wpn, actor, weaponentity,
-                                       button_atck | (button_atck2 << 1));
+                               this.weapon_think(wpn, actor, weaponentity, button_atck | (button_atck2 << 1));
                        }
                        else
                        {