From 8c3cc38560c124301457bbcb92fd3a2460956505 Mon Sep 17 00:00:00 2001 From: "Dr. Jaska" Date: Wed, 10 May 2023 16:44:18 +0000 Subject: [PATCH] fix g_maplist_remove completely breaking due to argv override --- qcsrc/common/command/generic.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 929d37653..3ce25e26d 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -274,11 +274,13 @@ void GenericCommand_maplist(int request, int argc) { if(argc == 3) { + // save argv(2) from being overridden by tokenize engine call + string del_map_name = argv(2); argc = tokenizebyseparator(cvar_string("g_maplist"), " "); tmp_string = ""; for(i = 0; i < argc; ++i) - if(argv(i) != argv(2)) + if(argv(i) != del_map_name) tmp_string = strcat(tmp_string, " ", argv(i)); tmp_string = substring(tmp_string, 1, strlen(tmp_string) - 1); -- 2.39.2