]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix g_maplist_remove completely breaking due to argv override
authorDr. Jaska <drjaska83@gmail.com>
Wed, 10 May 2023 16:44:18 +0000 (16:44 +0000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 10 May 2023 16:44:18 +0000 (16:44 +0000)
qcsrc/common/command/generic.qc

index 929d3765345084e1e85917705e498417e46563c0..3ce25e26d71272da71edde5d46f32ae482c7d879 100644 (file)
@@ -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);