diameter = vlen(mapMaxs - mapMins);
int twoBaseModes = 0;
- FOREACH(Gametypes, it.m_isTwoBaseMode(), twoBaseModes |= it.m_flags);
+ FOREACH(Gametypes, it.m_isTwoBaseMode(), twoBaseModes |= it.m_flags);
if(twoBaseModes && (twoBaseModes &= MapInfo_Map_supportedGametypes))
{
- // we have a CTF-only or Assault-only map. Don't add other modes then,
- // as the map is too symmetric for them.
+ // we have a symmetrical map, don't add the modes without bases
}
else
{
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_DEATHMATCH.m_flags; // DM always works
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_LMS.m_flags; // LMS always works
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEEPAWAY.m_flags; // Keepaway always works
-
- if(spawnpoints >= 8 && diameter > 4096) {
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_TEAM_DEATHMATCH.m_flags;
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG.m_flags;
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA.m_flags;
- }
- if(spawnpoints >= 12 && diameter > 5120)
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEYHUNT.m_flags;
+ FOREACH(Gametypes, it.m_isAlwaysSupported(it, spawnpoints, diameter), MapInfo_Map_supportedGametypes |= it.m_flags);
}
if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE.m_flags)
{
return false;
}
+ METHOD(Gametype, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ return false;
+ }
METHOD(Gametype, describe, string(Gametype this))
{
{
this.gametype_init(this, _("Deathmatch"),"dm","g_dm",false,"","timelimit=20 pointlimit=30 leadlimit=0",_("Score as many frags as you can"));
}
+ METHOD(Deathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ return true;
+ }
ENDCLASS(Deathmatch)
REGISTER_GAMETYPE(DEATHMATCH, NEW(Deathmatch));
{
this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",false,"","timelimit=20 lives=9 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
}
+ METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ return true;
+ }
ENDCLASS(LastManStanding)
REGISTER_GAMETYPE(LMS, NEW(LastManStanding));
}
return false;
}
+ METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ if(spawnpoints >= 8 && diameter > 4096)
+ return true;
+ return false;
+ }
ENDCLASS(TeamDeathmatch)
REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
#define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
}
return false;
}
+ METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ if(spawnpoints >= 8 && diameter > 4096)
+ return true;
+ return false;
+ }
#ifdef CSQC
ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
#endif
}
return false;
}
- METHOD(KeyHunt, m_modicons, void(vector pos, vector mySize))
+ METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
{
- #ifdef CSQC
- HUD_Mod_KH(pos, mySize);
- #endif
+ if(spawnpoints >= 12 && diameter > 5120)
+ return true;
+ return false;
}
#ifdef CSQC
ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
}
return false;
}
+ METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ if(spawnpoints >= 8 && diameter > 4096)
+ return true;
+ return false;
+ }
#ifdef CSQC
ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
#endif
{
this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",true,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
}
+ METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ return true;
+ }
#ifdef CSQC
ATTRIB(Keepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_Keepaway);
#endif