]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix maxplayers etc. in +serverconfig
authorRudolf Polzer <divverent@alientrap.org>
Fri, 23 Dec 2011 09:00:04 +0000 (10:00 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 23 Dec 2011 09:00:04 +0000 (10:00 +0100)
qcsrc/common/campaign_setup.qc
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/menu/xonotic/dialog_singleplayer.c
qcsrc/menu/xonotic/maplist.c
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/gamecommand.qc

index 3aae078adbf3431be6a8f57d45bde85eee207cd9..525b2856d45e661c73aaae69d329ff3495daad42 100644 (file)
@@ -8,5 +8,5 @@ void CampaignSetup(float n)
                localcmd(ftos(campaign_offset + n));
                localcmd("\n");
        localcmd("disconnect\nmaxplayers 16\n");
-       MapInfo_LoadMap(campaign_mapname[n]);
+       MapInfo_LoadMap(campaign_mapname[n], 1);
 }
index aad95a1fe5421c38ae4169ae282bb8c42978e079..a419e395a1952670b961e858b83a29094472453c 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,11 @@ 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"));
+       
+       if(reinit)
+               localcmd(strcat("\nsettemp_restore\nmap ", s, "\n"));
+       else
+               localcmd(strcat("\nsettemp_restore\nchangelevel ", s, "\n"));
 }
 
 string MapInfo_ListAllowedMaps(float pRequiredFlags, float pForbiddenFlags)
index ebfc0e4438e2c6426671a26dd09373221288b418..4de17c92430cfe20f2b0173b6113a20c5e748b09 100644 (file)
@@ -67,7 +67,7 @@ string MapInfo_FixName(string s);
 
 // play a map
 float MapInfo_CheckMap(string s); // returns 0 if the map can't be played with the current settings
-void MapInfo_LoadMap(string s);
+void MapInfo_LoadMap(string s, float reinit);
 
 // list all maps for the current game type
 string MapInfo_ListAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
index aff39ec174ec9ff7405080b3e6ddf0f6e374064a..6e1be0067a075606c74b13fba4aafabe8d63788b 100644 (file)
@@ -94,7 +94,7 @@ void InstantAction_LoadMap(entity btn, entity dummy)
                s = MapInfo_BSPName_ByID(m);
        }
        while(!fexists(sprintf("maps/%s.waypoints", s)));
-       MapInfo_LoadMap(s);
+       MapInfo_LoadMap(s, 1);
 
        // configure bots
        float p;
index 9ce298082c2fca2f236ba1ea987ebe001005a1f4..650e343c6b29f6c07db10bd00b91983054a3247a 100644 (file)
@@ -284,7 +284,7 @@ void MapList_LoadMap(entity btn, entity me)
                localcmd("\nmenu_loadmap_prepare\n");
                if(cvar("menu_use_default_hostname"))
                        localcmd("hostname \"", sprintf(_("%s's Xonotic Server"), strdecolorize(cvar_string("_cl_name"))), "\"\n");
-               MapInfo_LoadMap(m);
+               MapInfo_LoadMap(m, 1);
        }
        else
        {
index 8489145c12e040b8de7db2dd5bccc014d401b8da..9ddcaabac3fb991128d2c9c49337d0a189c59409 100644 (file)
@@ -311,7 +311,7 @@ entity SelectSpawnPoint (float anypoint)
        if (!spot)
        {
                if(autocvar_spawn_debug)
-                       GotoNextMap();
+                       GotoNextMap(0);
                else
                {
                        if(some_spawn_has_been_used)
index 95e3f7d61566c2cb26b1083d41d69d03e31a5a8a..8ce4ebdae08e669358a80fbe70b872eba5825f23 100644 (file)
@@ -44,9 +44,9 @@ float world_initialized;
 
 string GetMapname();
 string GetGametype();
-void GotoNextMap();
+void GotoNextMap(float reinit);
 void ShuffleMaplist()
-float() DoNextMapOverride;
+float(float reinit) DoNextMapOverride;
 
 void SetDefaultAlpha()
 {
@@ -189,8 +189,8 @@ void GotoFirstMap()
                MapInfo_Enumerate();
                MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
 
-               if(!DoNextMapOverride())
-                       GotoNextMap();
+               if(!DoNextMapOverride(1))
+                       GotoNextMap(1);
 
                return;
        }
@@ -1141,10 +1141,10 @@ void GameResetCfg()
        localcmd("\nsettemp_restore\n");
 }
 
-void Map_Goto()
+void Map_Goto(float reinit)
 {
        GameResetCfg();
-       MapInfo_LoadMap(getmapname_stored);
+       MapInfo_LoadMap(getmapname_stored, reinit);
 }
 
 // return codes of map selectors:
@@ -1280,7 +1280,7 @@ string GetNextMap()
        return "";
 }
 
-float DoNextMapOverride()
+float DoNextMapOverride(float reinit)
 {
        if(autocvar_g_campaign)
        {
@@ -1313,7 +1313,7 @@ float DoNextMapOverride()
                if(MapInfo_CheckMap(autocvar_nextmap))
                {
                        Map_Goto_SetStr(autocvar_nextmap);
-                       Map_Goto();
+                       Map_Goto(reinit);
                        alreadychangedlevel = TRUE;
                        return TRUE;
                }
@@ -1327,7 +1327,7 @@ float DoNextMapOverride()
        return FALSE;
 }
 
-void GotoNextMap()
+void GotoNextMap(float reinit)
 {
        //string nextmap;
        //float n, nummaps;
@@ -1359,7 +1359,7 @@ void GotoNextMap()
                                error("Everything is broken - not even the default map list works. Please report this to the developers.");
                        }
                }
-               Map_Goto();
+               Map_Goto(reinit);
        }
 }
 
@@ -2631,7 +2631,7 @@ float MapVote_Finished(float mappos)
                FixClientCvars(other);
 
        Map_Goto_SetStr(mapvote_maps[mappos]);
-       Map_Goto();
+       Map_Goto(0);
        alreadychangedlevel = TRUE;
        return TRUE;
 }
@@ -2827,11 +2827,11 @@ void MapVote_Think()
                }
 
                mapvote_initialized = TRUE;
-               if(DoNextMapOverride())
+               if(DoNextMapOverride(0))
                        return;
                if(!autocvar_g_maplist_votable || player_count <= 0)
                {
-                       GotoNextMap();
+                       GotoNextMap(0);
                        return;
                }
                MapVote_Init();
@@ -2848,7 +2848,7 @@ string GotoMap(string m)
        cvar_set("timelimit", "-1");
        if(mapvote_initialized || alreadychangedlevel)
        {
-               if(DoNextMapOverride())
+               if(DoNextMapOverride(0))
                        return "Map switch initiated.";
                else
                        return "Hm... no. For some reason I like THIS map more.";
index 986f2dd84536c7b7141dbe3065a340a817df7d5b..b4846d2fac2e5bd8388c18ce50ceb2aaad16027e 100644 (file)
@@ -229,7 +229,7 @@ void RadarMap_Next()
        else if(radarmapper.count & 2)
        {
                localcmd(strcat("defer 1 \"sv_cmd radarmap --flags ", ftos(radarmapper.count), strcat(" --res ", ftos(radarmapper.size_x), " ", ftos(radarmapper.size_y), " --sharpen ", ftos(radarmapper.ltime), " --qual ", ftos(radarmapper.size_z)), "\"\n"));
-               GotoNextMap();
+               GotoNextMap(0);
        }
        remove(radarmapper);
        radarmapper = world;