]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the last commit. It allowed the Mine Layer to go minus on ammo and place mines...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 20:45:22 +0000 (23:45 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 20:45:22 +0000 (23:45 +0300)
qcsrc/server/cl_weaponsystem.qc

index e372fd1aa0f912a31c469130930a1f99e95bdd08..e5ad4b66dd570126e579292849415224bdf81649 100644 (file)
@@ -1090,15 +1090,15 @@ void W_SwitchToOtherWeapon(entity pl)
 }
 float weapon_prepareattack_checkammo(float secondary)
 {
-       // always keep the Mine Layer if we placed mines, so that we can detonate them
-       local entity mine;
-       if(self.weapon == WEP_MINE_LAYER)
-       for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
-               return TRUE;
-
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary))
        {
+               // always keep the Mine Layer if we placed mines, so that we can detonate them
+               local entity mine;
+               if(self.weapon == WEP_MINE_LAYER)
+               for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
+                       return FALSE;
+
                W_SwitchToOtherWeapon(self);
                return FALSE;
        }