]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/world.qc
Make sure active custom gametype is not kept on the next map after manual gametype...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / world.qc
index 926349a575665fb8d9c85499557d6be318487a61..b6fbe0d85f3796c649a639dabcf31b2a9cb11c53 100644 (file)
@@ -736,7 +736,9 @@ void InitGameplayMode()
 
        MapInfo_ClearTemps();
 
-       gamemode_name = MapInfo_Type_ToText(MapInfo_LoadedGametype);
+       strcpy(loaded_gametype_custom_string, autocvar__sv_vote_gametype_custom);
+       gametype_custom_enabled = (loaded_gametype_custom_string != "");
+       cvar_set("_sv_vote_gametype_custom", ""); // clear it immediately so it can't get stuck
 
        cache_mutatormsg = strzone("");
        cache_lastmutatormsg = strzone("");
@@ -2433,7 +2435,7 @@ void RunThink(entity this, float dt)
 
        float oldtime = time; // do we need to save this?
 
-       for (int iterations = 0; iterations < 128 && !wasfreed(this); iterations++)
+       for (int iterations = 0; iterations < 128 && !wasfreed(this); ++iterations)
        {
                time = max(oldtime, this.nextthink);
                this.nextthink = 0;
@@ -2644,6 +2646,7 @@ void Shutdown()
                MapInfo_Shutdown();
 
                strfree(sv_termsofservice_url_escaped);
+               strfree(loaded_gametype_custom_string);
        }
        else if(world_initialized == 0)
        {