{
int r = MapInfo_Get_ByName_NoFallbacks(pFilename, pAllowGenerate, pGametypeToSet);
- if(cvar("g_tdm_on_dm_maps"))
- {
- // if this is set, all DM maps support TDM too
- if (!(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH.m_flags))
- if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags)
- _MapInfo_Map_ApplyGametypeEx ("", pGametypeToSet, MAPINFO_TYPE_TEAM_DEATHMATCH);
- }
+ FOREACH(Gametypes, it.m_isForcedSupported(it), _MapInfo_Map_ApplyGametypeEx("", pGametypeToSet, it));
if(pGametypeToSet)
{
{
return false;
}
+ METHOD(Gametype, m_isForcedSupported, bool(Gametype this))
+ {
+ return false;
+ }
METHOD(Gametype, describe, string(Gametype this))
{
return true;
return false;
}
+ METHOD(TeamDeathmatch, m_isForcedSupported, bool(Gametype this))
+ {
+ if(cvar("g_tdm_on_dm_maps"))
+ {
+ // if this is set, all DM maps support TDM too
+ if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
+ return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+ }
+ return false;
+ }
METHOD(TeamDeathmatch, m_setTeams, void(string sa))
{
cvar_set("g_tdm_teams", sa);