]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
rewrite settemp system to handle "quit" right
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index aad95a1fe5421c38ae4169ae282bb8c42978e079..699a132fde2e97d62df9e3e8a9e97a479468ade7 100644 (file)
@@ -1290,7 +1290,7 @@ void MapInfo_SwitchGameType(float t)
        cvar_set("g_keepaway",   (t == MAPINFO_TYPE_KEEPAWAY)        ? "1" : "0");
 }
 
-void MapInfo_LoadMap(string s)
+void MapInfo_LoadMap(string s, float reinit)
 {
        MapInfo_Map_supportedGametypes = 0;
        // we shouldn't need this, as LoadMapSettings already fixes the gametype
@@ -1299,7 +1299,12 @@ void MapInfo_LoadMap(string s)
        //      print("EMERGENCY: can't play the selected map in the given game mode. Falling back to DM.\n");
        //      MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH);
        //}
-       localcmd(strcat("\nsettemp_restore\nchangelevel ", s, "\n"));
+       
+       cvar_settemp_restore();
+       if(reinit)
+               localcmd(strcat("\nmap ", s, "\n"));
+       else
+               localcmd(strcat("\nchangelevel ", s, "\n"));
 }
 
 string MapInfo_ListAllowedMaps(float pRequiredFlags, float pForbiddenFlags)