]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If no supported gamemodes are available, fall back to a randomly selected preferred...
authorMario <mario.mario@y7mail.com>
Tue, 14 Jul 2020 08:14:09 +0000 (18:14 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 14 Jul 2020 08:14:09 +0000 (18:14 +1000)
qcsrc/client/hud/panel/physics.qc
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/vote.qc
qcsrc/client/shownames.qc
qcsrc/common/mapinfo.qc

index d45aea2c1109248b171c8ae0b316d4dc88aa3e3f..139f29c3099f83ec00c969c7c8e59436929e91de 100644 (file)
@@ -4,8 +4,6 @@
 #include <client/defs.qh>
 #include <client/miscfunctions.qh>
 #include <client/main.qh>
-#include <common/gamemodes/_mod.qh>
-#include <common/mapinfo.qh>
 #include <lib/csqcmodel/cl_player.qh>
 
 // Physics (#15)
index 9bc62b283ab2c326cddac848112e4ca2ca0c691e..a0a971cb1f1732b95ddafae8b136303b6f1db0f5 100644 (file)
@@ -3,8 +3,6 @@
 #include <client/autocvars.qh>
 #include <client/defs.qh>
 #include <client/miscfunctions.qh>
-#include <common/gamemodes/_mod.qh>
-#include <common/mapinfo.qh>
 
 // Race timer (#8)
 
index a2776b662d2c4ce3e2b79c653bdb306e51d5b342..59bfa1a95ae9c256319b26b04518583ade31e31a 100644 (file)
@@ -4,7 +4,6 @@
 #include <client/defs.qh>
 #include <client/miscfunctions.qh>
 #include <common/ent_cs.qh>
-#include <common/gamemodes/_mod.qh>
 #include <client/mapvoting.qh>
 #include <client/resources.qh>
 #include <client/teamradar.qh>
index 32db0a29fbf6d16ec6d478319fd20fc2b76e45d2..a6ec774b870a1cf85623115e79927e7f39289ca7 100644 (file)
@@ -5,8 +5,6 @@
 #include <client/miscfunctions.qh>
 #include "scoreboard.qh"
 #include <common/ent_cs.qh>
-#include <common/gamemodes/_mod.qh>
-#include <common/mapinfo.qh>
 #include <common/scores.qh>
 
 // Score (#7)
index 8b6b95ed33ea0fff8e9d8e114e83bd09a79e9c76..47e08cbd835be0905cdd6689fe292d6a21e36df8 100644 (file)
@@ -7,7 +7,6 @@
 #include "quickmenu.qh"
 #include <common/ent_cs.qh>
 #include <common/constants.qh>
-#include <common/gamemodes/_mod.qh>
 #include <common/net_linked.qh>
 #include <common/mapinfo.qh>
 #include <common/minigames/cl_minigames.qh>
index 8b707f7bfb6c0bd3e1b54cddf1cb1e24d6b2fc61..60f8394900203204be439257a509e5f46cc7af8c 100644 (file)
@@ -2,9 +2,7 @@
 
 #include <client/autocvars.qh>
 #include <client/defs.qh>
-#include <common/gamemodes/_mod.qh>
 #include <client/miscfunctions.qh>
-#include <common/mapinfo.qh>
 
 // Vote (#9)
 
index e44e18f753b881a2969ad6887427c4d7727becc7..d4a221cbc8a09c238faa5d44b4b7930fd8c2239a 100644 (file)
@@ -7,9 +7,7 @@
 
 #include <common/ent_cs.qh>
 #include <common/constants.qh>
-#include <common/gamemodes/_mod.qh>
 #include <common/net_linked.qh>
-#include <common/mapinfo.qh>
 #include <common/teams.qh>
 
 #include <lib/csqcmodel/cl_model.qh>
index f6137ed4a12765ab970ac055361e659d7c94b88b..58fb5bfcaedfb322e449c135fd2ba4b4bb4696c7 100644 (file)
@@ -1251,10 +1251,17 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
 
                if(MapInfo_Map_supportedGametypes == 0)
                {
-                       LOG_SEVERE("Mapinfo system is not functional at all. Assuming deathmatch.");
-                       MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH.m_flags;
-                       MapInfo_LoadMapSettings_SaveGameType(MAPINFO_TYPE_DEATHMATCH);
-                       _MapInfo_Map_ApplyGametypeEx("", MAPINFO_TYPE_DEATHMATCH, MAPINFO_TYPE_DEATHMATCH);
+                       RandomSelection_Init();
+                       FOREACH(Gametypes, it.m_priority == 2, 
+                       {
+                               MapInfo_Map_supportedGametypes |= it.m_flags;
+                               RandomSelection_AddEnt(it, 1, 1);
+                       });
+                       if(RandomSelection_chosen_ent)
+                               t = RandomSelection_chosen_ent;
+                       LOG_SEVEREF("Mapinfo system is not functional at all. Falling back to a preferred mode (%s).", t.mdl);
+                       MapInfo_LoadMapSettings_SaveGameType(t);
+                       _MapInfo_Map_ApplyGametypeEx("", t, t);
                        return; // do not call Get_ByName!
                }