}
else
{
- Gametype type = MapInfo_Type_FromString(gt, false);
+ Gametype type = MapInfo_Type_FromString(gt, false, false);
mv_pk3[i] = strzone(MapInfo_Type_ToText(type));
mv_desc[i] = MapInfo_Type_Description(type);
}
}
}
-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 "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 != "")
{
// type in quake 3 holds all the supported gametypes, so we must loop through all of them
FOREACH_WORD(s, 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;
}
// gets a gametype from a string
string _MapInfo_GetDefaultEx(Gametype t);
float _MapInfo_GetTeamPlayBool(Gametype t);
-Gametype MapInfo_Type_FromString(string t, bool dowarn);
+Gametype MapInfo_Type_FromString(string t, bool dowarn, bool is_q3compat);
string MapInfo_Type_Description(Gametype t);
string MapInfo_Type_ToString(Gametype t);
string MapInfo_Type_ToText(Gametype t);
}
if(this.gametype != "")
- MapInfo_SwitchGameType(MapInfo_Type_FromString(this.gametype, false));
+ MapInfo_SwitchGameType(MapInfo_Type_FromString(this.gametype, false, false));
if (this.chmap == "")
{
if(s != "data")
modname = sprintf("%s (%s)", modname, s);
- Gametype j = MapInfo_Type_FromString(typestr, false); // try and get the real name of the game type
+ Gametype j = MapInfo_Type_FromString(typestr, false, false); // try and get the real name of the game type
if(j) { typestr = MapInfo_Type_ToText(j); } // only set it if we actually found it
me.currentServerType = strzone(typestr);
string thismapname, wantedmapname;
thismapname = GetMapname();
wantedmapname = campaign_gametype[0];
- if(MapInfo_CurrentGametype() != MapInfo_Type_FromString(wantedmapname, false))
+ if(MapInfo_CurrentGametype() != MapInfo_Type_FromString(wantedmapname, false, false))
return CampaignBailout("wrong game type!");
wantedmapname = campaign_mapname[0];
if(wantedmapname != thismapname)
if(autocvar_sv_cheats)
{
- MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0], false));
+ MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0], false, false));
CampaignFile_Unload();
CampaignBailout("JOLLY CHEATS AHAHAHAHAHAHAH))");
return;
cvar_settemp("skill", ftos(baseskill));
cvar_settemp("bot_number", ftos(campaign_bots[0]));
- MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0], false));
+ MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0], false, false));
if(Campaign_Invalid())
return;
if (argv(1) != "")
{
string s = argv(1);
- Gametype t = MapInfo_Type_FromString(s, false), tsave = MapInfo_CurrentGametype();
+ Gametype t = MapInfo_Type_FromString(s, false, false), tsave = MapInfo_CurrentGametype();
if (t)
{
*/
Gametype GameTypeVote_Type_FromString(string type_name)
{
- Gametype type = MapInfo_Type_FromString(type_name, false);
+ Gametype type = MapInfo_Type_FromString(type_name, false, false);
if (type == NULL)
type = MapInfo_Type_FromString(cvar_string(
- strcat("sv_vote_gametype_",type_name,"_type")), false);
+ strcat("sv_vote_gametype_",type_name,"_type")), false, false);
return type;
}
{
int flag = GTV_FORBIDDEN;
- Gametype type = MapInfo_Type_FromString(type_name, false);
+ Gametype type = MapInfo_Type_FromString(type_name, false, false);
if ( type == NULL )
{
type = MapInfo_Type_FromString(cvar_string(
- strcat("sv_vote_gametype_",type_name,"_type")), false);
+ strcat("sv_vote_gametype_",type_name,"_type")), false, false);
flag |= GTV_CUSTOM;
}