From: Mario Date: Sun, 9 Sep 2018 16:57:20 +0000 (+1000) Subject: If the player has unlimited superweapons, don't bother showing pickup message or... X-Git-Tag: xonotic-v0.8.5~1889 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=821dd89b9ce401e6c40628cf5a75c502ed078d5a;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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;