From: Mario Date: Tue, 14 Jul 2020 08:14:09 +0000 (+1000) Subject: If no supported gamemodes are available, fall back to a randomly selected preferred... X-Git-Tag: xonotic-v0.8.5~855^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1d2d6b2b5e13b035f40dbaf4f197f82aceccde52;p=xonotic%2Fxonotic-data.pk3dir.git If no supported gamemodes are available, fall back to a randomly selected preferred gamemode (currently only DM) instead of switching directly to DM --- diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index d45aea2c1..139f29c30 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include // Physics (#15) diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index 9bc62b283..a0a971cb1 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -3,8 +3,6 @@ #include #include #include -#include -#include // Race timer (#8) diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index a2776b662..59bfa1a95 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index 32db0a29f..a6ec774b8 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -5,8 +5,6 @@ #include #include "scoreboard.qh" #include -#include -#include #include // Score (#7) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 8b6b95ed3..47e08cbd8 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -7,7 +7,6 @@ #include "quickmenu.qh" #include #include -#include #include #include #include diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index 8b707f7bf..60f839490 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -2,9 +2,7 @@ #include #include -#include #include -#include // Vote (#9) diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index e44e18f75..d4a221cbc 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -7,9 +7,7 @@ #include #include -#include #include -#include #include #include diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index f6137ed4a..58fb5bfca 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -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! }