]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_weaponsystem.qc
Merge remote branch 'origin/master' into terencehill/essential_weapons_panel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weaponsystem.qc
index 3d7a33278d15201ce89b789f1a03f9441e0d0be8..0b73f36144994867b931c422980d4b348e28348f 100644 (file)
@@ -34,10 +34,6 @@ float W_WeaponRateFactor()
 
 void W_SwitchWeapon_Force(entity e, float w)
 {
-       // don't switch to another weapon if we're not allowed to
-       if(e.weapon_forbidchange)
-               return;
-
        e.cnt = e.switchweapon;
        e.switchweapon = w;
        e.selectweapon = w;
@@ -1007,7 +1003,10 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
 void w_clear()
 {
        if (self.weapon != -1)
+       {
                self.weapon = 0;
+               self.switchingweapon = 0;
+       }
        if (self.weaponentity)
        {
                self.weaponentity.state = WS_CLEAR;
@@ -1033,6 +1032,7 @@ void weapon_setup(float windex)
 
        // the two weapon entities will notice this has changed and update their models
        self.weapon = windex;
+       self.switchingweapon = windex; // to make sure
        self.weaponname = e.mdl;
        self.bulletcounter = 0;
 };