From f2f676789bff4715981fa84c72cd349db6a6b080 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Jul 2020 20:11:31 +1000 Subject: [PATCH] Add a gametype flag to indicate that a gametype shouldn't display standard score limits in the scoreboard (for instance, LMS limits are counted per-player) --- qcsrc/client/hud/panel/scoreboard.qc | 2 +- qcsrc/common/gamemodes/gamemode/lms/lms.qh | 2 +- qcsrc/common/mapinfo.qh | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index fc49d5601b..8b6b95ed33 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1628,7 +1628,7 @@ void Scoreboard_Draw() str = ""; if(tl > 0) str = strcat(str, sprintf(_("^3%1.0f minutes"), tl)); - if(!ISGAMETYPE(LMS)) + if(!gametype.m_hidelimits) { if(fl > 0) { diff --git a/qcsrc/common/gamemodes/gamemode/lms/lms.qh b/qcsrc/common/gamemodes/gamemode/lms/lms.qh index 0191839a43..8a208c5839 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/lms.qh +++ b/qcsrc/common/gamemodes/gamemode/lms/lms.qh @@ -5,7 +5,7 @@ CLASS(LastManStanding, Gametype) INIT(LastManStanding) { - this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 lives=5 leadlimit=0",_("Survive and kill until the enemies have no lives left")); + this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_HIDELIMITS,"","timelimit=20 lives=5 leadlimit=0",_("Survive and kill until the enemies have no lives left")); } METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) { diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index c5b9906c13..2d6681ec6a 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -20,6 +20,7 @@ const int GAMETYPE_FLAG_TEAMPLAY = BIT(0); // teamplay based const int GAMETYPE_FLAG_USEPOINTS = BIT(1); // gametype has point-based scoring const int GAMETYPE_FLAG_PREFERRED = BIT(2); // preferred (when available) in random selections const int GAMETYPE_FLAG_PRIORITY = BIT(3); // priority selection when preferred gametype isn't available in random selections +const int GAMETYPE_FLAG_HIDELIMITS = BIT(4); // don't display a score limit needed for winning the match in the scoreboard int MAPINFO_TYPE_ALL; .int m_flags; @@ -38,6 +39,8 @@ CLASS(Gametype, Object) ATTRIB(Gametype, team, bool, false); /** does this gametype use a point limit? */ ATTRIB(Gametype, frags, bool, true); + /** should this gametype display a score limit in the scoreboard? */ + ATTRIB(Gametype, m_hidelimits, bool, false); /** game type defaults */ ATTRIB(Gametype, model2, string); /** game type description */ @@ -103,6 +106,7 @@ CLASS(Gametype, Object) this.gametype_description = gdescription; this.frags = (gflags & GAMETYPE_FLAG_USEPOINTS); this.m_priority = ((gflags & GAMETYPE_FLAG_PREFERRED) ? 2 : ((gflags & GAMETYPE_FLAG_PRIORITY) ? 1 : 0)); + this.m_hidelimits = (gflags & GAMETYPE_FLAG_HIDELIMITS); // same as `1 << m_id` MAPINFO_TYPE_ALL |= this.items = this.m_flags = (MAPINFO_TYPE_ALL + 1); -- 2.39.2