From: terencehill Date: Thu, 10 Oct 2024 10:56:30 +0000 (+0200) Subject: Fix #2939 "New Toys showing up as an active modification" X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=855cdbde52147d4151ed16f275fcedc05211c6b4;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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 != "") {