From bd5890a8c00134354059a1121d1fb6350839edbd Mon Sep 17 00:00:00 2001 From: Oscar Linderholm Date: Wed, 15 Jan 2025 17:30:01 +0100 Subject: [PATCH] Query f_{modified,ruleset,version} if matchtag is set --- src/match.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/match.c b/src/match.c index 184b8b82..f4c79a88 100644 --- a/src/match.c +++ b/src/match.c @@ -283,6 +283,8 @@ void EndMatch(float skip_log) float f1; qbool is_real_match_end = !isHoonyModeAny() || HM_is_game_over(); qbool f_modified_done = false, f_ruleset_done = false, f_version_done = false; + char *matchtag = ezinfokey(world, "matchtag"); + qbool has_matchtag = matchtag != NULL && matchtag[0]; if (match_over || !match_in_progress) { @@ -401,17 +403,17 @@ void EndMatch(float skip_log) { p->ready = 0; // force players be not ready after match is end. - if (cvar("k_on_end_f_modified") && !f_modified_done) + if (has_matchtag && cvar("k_on_end_f_modified") && !f_modified_done) { stuffcmd(p, "say f_modified\n"); f_modified_done = true; } - if (cvar("k_on_end_f_ruleset") && !f_ruleset_done) + if (has_matchtag && cvar("k_on_end_f_ruleset") && !f_ruleset_done) { stuffcmd(p, "say f_ruleset\n"); f_ruleset_done = true; } - if (cvar("k_on_end_f_version") && !f_version_done) + if (has_matchtag && cvar("k_on_end_f_version") && !f_version_done) { stuffcmd(p, "say f_version\n"); f_version_done = true; @@ -2634,6 +2636,8 @@ void PlayerReady(qbool startIdlebot) { gedict_t *p; float nready; + char *matchtag = ezinfokey(world, "matchtag"); + qbool has_matchtag = matchtag != NULL && matchtag[0]; if (isRACE() && !race_match_mode()) { @@ -2817,17 +2821,17 @@ void PlayerReady(qbool startIdlebot) G_bprint(2, "All players ready\n"); } - if (cvar("k_on_start_f_modified")) + if (has_matchtag && cvar("k_on_start_f_modified")) { stuffcmd(self, "say f_modified\n"); } - if (cvar("k_on_start_f_ruleset")) + if (has_matchtag && cvar("k_on_start_f_ruleset")) { stuffcmd(self, "say f_ruleset\n"); } - if (cvar("k_on_start_f_version")) + if (has_matchtag && cvar("k_on_start_f_version")) { stuffcmd(self, "say f_version\n"); }