#include "mapinfo.qh"
#if defined(CSQC)
- #include "../client/defs.qh"
#include "util.qh"
#include <common/weapons/_all.qh>
#elif defined(MENUQC)
}
}
-Gametype MapInfo_Type_FromString(string gtype, bool dowarn)
+Gametype MapInfo_Type_FromString(string gtype, bool dowarn, bool is_q3compat)
{
string replacement = "";
bool do_warn = true;
case "ffa": replacement = "dm"; do_warn = false; break;
case "cctf":
case "oneflag": replacement = "ctf"; do_warn = false; break;
- case "team": replacement = "tdm"; do_warn = false; break;
case "tourney": replacement = "duel"; do_warn = false; break;
+ case "arena": if(is_q3compat) { replacement = "ca"; do_warn = false; } break;
}
if (replacement != "")
{
// if there is a valid gametype in this .arena file, include it in the menu
stored_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
// type in quake 3 holds all the supported gametypes, so we must loop through all of them
- FOREACH_WORD(s, true,
+ string types = strreplace("team", "tdm ft", s); // TODO: handle support here better to include more Xonotic teamplay modes
+ FOREACH_WORD(types, true,
{
- Gametype f = MapInfo_Type_FromString(it, false);
+ Gametype f = MapInfo_Type_FromString(it, false, true);
if(f)
stored_supportedGametypes |= f.m_flags;
});
else if(t == "type")
{
t = car(s); s = cdr(s);
- Gametype f = MapInfo_Type_FromString(t, true);
+ Gametype f = MapInfo_Type_FromString(t, true, false);
//if(WARN_COND)
//LOG_WARN("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.");
if(f)
else if(t == "gametype")
{
t = car(s); s = cdr(s);
- Gametype f = MapInfo_Type_FromString(t, true);
+ Gametype f = MapInfo_Type_FromString(t, true, false);
if(f)
_MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
else if(WARN_COND)
t = car(s); s = cdr(s);
bool all = t == "all";
Gametype f = NULL;
- if(all || (f = MapInfo_Type_FromString(t, true)))
+ if(all || (f = MapInfo_Type_FromString(t, true, false)))
{
if((all ? MAPINFO_TYPE_ALL : f.m_flags) & pGametypeToSet.m_flags)
{
t = car(s); s = cdr(s);
bool all = t == "all";
Gametype f = NULL;
- if(all || (f = MapInfo_Type_FromString(t, true)))
+ if(all || (f = MapInfo_Type_FromString(t, true, false)))
{
if((all ? MAPINFO_TYPE_ALL : f.m_flags) & pGametypeToSet.m_flags)
{
Gametype MapInfo_CurrentGametype()
{
- Gametype prev = MapInfo_Type_FromString(cvar_string("gamecfg"), false);
+ Gametype prev = MapInfo_Type_FromString(cvar_string("gamecfg"), false, false);
FOREACH(Gametypes, cvar(it.netname) && it != prev, return it);
return prev ? prev : MAPINFO_TYPE_DEATHMATCH;
}