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: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=1d2d6b2b5e13b035f40dbaf4f197f82aceccde52 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 d45aea2c11..139f29c309 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 9bc62b283a..a0a971cb1f 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 a2776b662d..59bfa1a95a 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 32db0a29fb..a6ec774b87 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 8b6b95ed33..47e08cbd83 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 8b707f7bfb..60f8394900 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 e44e18f753..d4a221cbc8 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 f6137ed4a1..58fb5bfcae 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! }