From 855cdbde52147d4151ed16f275fcedc05211c6b4 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 10 Oct 2024 12:56:30 +0200 Subject: [PATCH] Fix #2939 "New Toys showing up as an active modification" Client code was wrongly building the active mutator list from local cvars when no mutator is active on the server --- qcsrc/common/util.qc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 1bc669d83..4ad93f914 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -227,11 +227,19 @@ bool mut_is_active(int mut) return (active_mutators[0] & BIT(mut)); } -// if s == "" (MENUQC) builds the mutator list for the Mutators dialog based on local cvar values -// otherwise (CSQC) translates the mutator list (s) that client has received from server -// NOTE: this function merges MENUQC and CSQC code in order to avoid duplicating and separating strings +// MENUQC: it builds the mutator list based on local cvars (for the Mutators dialog) +// CSQC: it translates the mutator list received from server (for the Welcome dialog) +// MENUQC and CSQC code is merged in order to avoid duplicating and separating strings string build_mutator_list(string s) { + #ifdef CSQC + if (s == "") return ""; + #endif + + #ifdef MENUQC + if (s != "") s = ""; + #endif + int i = -1, n = 0; // allow only 1 iteration in the following for loop if (s == "") if (s != "") { -- 2.39.2