]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't switch away from the Mine Layer when pressing primary fire if there are mines...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 20:40:49 +0000 (23:40 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 20:40:49 +0000 (23:40 +0300)
qcsrc/server/cl_weaponsystem.qc

index 925d53fa7e3cc218cfeba460f432969db25d7a47..e372fd1aa0f912a31c469130930a1f99e95bdd08 100644 (file)
@@ -1090,6 +1090,12 @@ 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))
        {