]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
if throwing away superweapon, it's over
authorRudolf Polzer <divverent@alientrap.org>
Thu, 12 Jan 2012 17:23:39 +0000 (18:23 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 12 Jan 2012 17:23:39 +0000 (18:23 +0100)
qcsrc/server/cl_client.qc

index 40b82224b02966f8d78c5902c2ea0ad4571e58fc..ebf4abc4b4d85bc7181fd408221f03c75df988a4 100644 (file)
@@ -1895,17 +1895,26 @@ void player_powerups (void)
                }
                if (self.items & IT_SUPERWEAPON)
                {
-                       play_countdown(self.superweapons_finished, "misc/poweroff.wav");
                        self.effects = self.effects | EF_RED;
-                       if (self.items & IT_UNLIMITED_SUPERWEAPONS)
+                       if (!(self.weapons & WEPBIT_SUPERWEAPONS))
+                       {
+                               self.superweapons_finished = 0;
+                               self.items = self.items - (self.items & IT_SUPERWEAPON);
+                               sprint(self, "^3Superweapons have been lost\n");
+                       }
+                       else if (self.items & IT_UNLIMITED_SUPERWEAPONS)
                        {
                                // don't let them run out
                        }
-                       else if (time > self.superweapons_finished)
+                       else
                        {
-                               self.items = self.items - (self.items & IT_SUPERWEAPON);
-                               self.weapons &~= WEPBIT_SUPERWEAPONS;
-                               sprint(self, "^3Superweapons have broken down\n");
+                               play_countdown(self.superweapons_finished, "misc/poweroff.wav");
+                               if (time > self.superweapons_finished)
+                               {
+                                       self.items = self.items - (self.items & IT_SUPERWEAPON);
+                                       self.weapons &~= WEPBIT_SUPERWEAPONS;
+                                       sprint(self, "^3Superweapons have broken down\n");
+                               }
                        }
                }
                else