]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If the player has unlimited superweapons, don't bother showing pickup message or...
authorMario <zacjardine@y7mail.com>
Sun, 9 Sep 2018 16:57:20 +0000 (02:57 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 9 Sep 2018 16:57:20 +0000 (02:57 +1000)
qcsrc/client/hud/panel/powerups.qc
qcsrc/server/client.qc
qcsrc/server/miscfunctions.qc

index 947bfd53b3ee1075063b72a489ece3b981811753..49b7a97018c0071d4170e06fe43e8bd274d7d905 100644 (file)
@@ -103,7 +103,7 @@ void HUD_Powerups()
                addPowerupItem("Strength", "strength", autocvar_hud_progressbar_strength_color, strengthTime, 30);
        if(shieldTime)
                addPowerupItem("Shield", "shield", autocvar_hud_progressbar_shield_color, shieldTime, 30);
-       if(superTime)
+       if(superTime && !(allItems & IT_UNLIMITED_SUPERWEAPONS))
                addPowerupItem("Superweapons", "superweapons", autocvar_hud_progressbar_superweapons_color, superTime, 30);
 
        MUTATOR_CALLHOOK(HUD_Powerups_add);
index 2418500efb121ebcd7ab57f0a633d4cc0a12c9c9..8b70a633af9ebc59a394e1093684a34d852d7470 100644 (file)
@@ -1450,9 +1450,12 @@ void player_powerups(entity this)
                        if (time < this.superweapons_finished || (this.items & IT_UNLIMITED_SUPERWEAPONS))
                        {
                                this.items = this.items | IT_SUPERWEAPON;
-                               if(!g_cts)
-                                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
-                               Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
+                               if(!(this.items & IT_UNLIMITED_SUPERWEAPONS))
+                               {
+                                       if(!g_cts)
+                                               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
+                                       Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
+                               }
                        }
                        else
                        {
index 7ed094cc3a616f6f4b91f0bbe5314e79273cf292..f8a2cd79ee60ff26314ce71f9d45502017e05f30 100644 (file)
@@ -632,6 +632,9 @@ void readplayerstartcvars()
                });
        }
 
+       if(cvar("g_balance_superweapons_time") < 0)
+               start_items |= IT_UNLIMITED_SUPERWEAPONS;
+
        if(!cvar("g_use_ammunition"))
                start_items |= IT_UNLIMITED_AMMO;