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 d45aea2..139f29c 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 9bc62b2..a0a971c 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 a2776b6..59bfa1a 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 32db0a2..a6ec774 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 8b6b95e..47e08cb 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 8b707f7..60f8394 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 e44e18f..d4a221c 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 f6137ed..58fb5bf 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!
                }