float r;
float diameter, spawnpoints;
float spawnplaces;
+ bool is_q3df_map = false;
vector mapMins, mapMaxs;
_MapInfo_Map_worldspawn_music = v;
else if(k == "noise")
_MapInfo_Map_worldspawn_music = v;
- else if(k == "message")
+ else if(k == "message" && (!MapInfo_Map_title || MapInfo_Map_title == "<TITLE>"))
{
i = strstrofs(v, " by ", 0);
if(MapInfo_Map_author == "<AUTHOR>" && i >= 0)
MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_MONSTERS;
else if(v == "target_music" || v == "trigger_music")
_MapInfo_Map_worldspawn_music = string_null; // don't use regular BGM
+ else if(v == "target_stopTimer")
+ is_q3df_map = true; // don't support standard gamemodes
else
FOREACH(Gametypes, true, it.m_generate_mapinfo(it, v));
}
{
// we have a symmetrical map, don't add the modes without bases
}
- else
+ else if(!is_q3df_map)
{
FOREACH(Gametypes, it.m_isAlwaysSupported(it, spawnpoints, diameter), MapInfo_Map_supportedGametypes |= it.m_flags);
}
stored_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
// type in quake 3 holds all the supported gametypes, so we must loop through all of them
// TODO: handle support here better to include more Xonotic teamplay modes
- string types = strreplace("team", "tdm ft", s);
- if(strstrofs(s, "tournament", 0) < 0 && strstrofs(s, "tdm", 0) >= 0) // larger team map, support additional gamemodes!
+ string types = s;
+ types = strreplace("team", "tdm ft", types);
+ types = strreplace("ffa", "dm lms ka", types);
+ if(strstrofs(types, "tournament", 0) < 0 && strstrofs(types, "tdm", 0) >= 0) // larger team map, support additional gamemodes!
types = cons(types, "ca kh");
FOREACH_WORD(types, true,
{
return false;
}
-#if defined(CSQC) || defined(MENUQC)
-string(string filename) whichpack = #503;
-#endif
string _MapInfo_CheckArenaFile(string pFilename, string pMapname)
{
// returns the file name if valid, otherwise returns ""
fh = fopen(fn, FILE_READ);
if(fh < 0)
{
- if(autocvar_g_mapinfo_q3compat == 1) // use arena data instead of generating a mapinfo file
+ if(autocvar_g_mapinfo_q3compat) // use arena data instead of generating a mapinfo file
{
bool isdefi = false;
- fn = _MapInfo_FindArenaFile(pFilename, ".arena");
- if(fn != "")
- fh = fopen(fn, FILE_READ);
- if(fh < 0)
+ if(autocvar_g_mapinfo_q3compat == 1) // only parse .arena files in mode 1
+ {
+ fn = _MapInfo_FindArenaFile(pFilename, ".arena");
+ if(fn != "")
+ fh = fopen(fn, FILE_READ);
+ }
+ if(fh < 0 || autocvar_g_mapinfo_q3compat == 2)
{
isdefi = true;
fn = _MapInfo_FindArenaFile(pFilename, ".defi");
return r;
}
+bool MapReadSizes(string map)
+{
+ // TODO: implement xonotic#28 / xonvote 172 (sizes in mapinfo)
+ string readsize_msg = strcat("MapReadSizes ", map);
+ float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
+ if(fh >= 0)
+ {
+ map_minplayers = stoi(fgets(fh));
+ map_maxplayers = stoi(fgets(fh));
+ fclose(fh);
+ LOG_TRACEF(readsize_msg, ": ok, min %d max %d", map_minplayers, map_maxplayers);
+ return true;
+ }
+ LOG_TRACE(readsize_msg, ": not found");
+ return false;
+}
+
float MapInfo_FindName(string s)
{
// if there is exactly one map of prefix s, return it