From: Dr. Jaska Date: Wed, 10 May 2023 16:44:18 +0000 (+0000) Subject: fix g_maplist_remove completely breaking due to argv override X-Git-Tag: xonotic-v0.8.6~113^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c3cc38560c124301457bbcb92fd3a2460956505;p=xonotic%2Fxonotic-data.pk3dir.git fix g_maplist_remove completely breaking due to argv override --- 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);