From 821dd89b9ce401e6c40628cf5a75c502ed078d5a Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 10 Sep 2018 02:57:20 +1000 Subject: [PATCH] If the player has unlimited superweapons, don't bother showing pickup message or HUD timer, also enable unlimited superweapons if g_balance_superweapons_time < 0 --- qcsrc/client/hud/panel/powerups.qc | 2 +- qcsrc/server/client.qc | 9 ++++++--- qcsrc/server/miscfunctions.qc | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/hud/panel/powerups.qc b/qcsrc/client/hud/panel/powerups.qc index 947bfd53b..49b7a9701 100644 --- a/qcsrc/client/hud/panel/powerups.qc +++ b/qcsrc/client/hud/panel/powerups.qc @@ -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); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 2418500ef..8b70a633a 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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 { diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 7ed094cc3..f8a2cd79e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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; -- 2.39.2