#include "mapinfo.qh"
#endif
+bool autocvar_developer_mapper;
+
+#define LOG_MAPWARN(...) MACRO_BEGIN { if (autocvar_developer_mapper) LOG_WARNING(__VA_ARGS__); } MACRO_END
+#define LOG_MAPWARNF(...) MACRO_BEGIN { if (autocvar_developer_mapper) LOG_WARNINGF(__VA_ARGS__); } MACRO_END
+
// generic string stuff
int _MapInfo_Cache_Active;
}
if(inWorldspawn)
{
- LOG_INFO(fn, " ended still in worldspawn, BUG\n");
+ LOG_MAPWARN(fn, " ended still in worldspawn, BUG\n");
return 0;
}
diameter = vlen(mapMaxs - mapMins);
if (sa == "") continue;
int p = strstrofs(sa, "=", 0);
if (p < 0) {
- LOG_WARNINGF("Invalid gametype setting in mapinfo for gametype %s: %s\n", MapInfo_Type_ToString(pWantedType), sa);
+ LOG_MAPWARNF("Invalid gametype setting in mapinfo for gametype %s: %s\n", MapInfo_Type_ToString(pWantedType), sa);
continue;
}
string k = substring(sa, 0, p);
}
FOREACH(Gametypes, true, LAMBDA(handled |= it.m_parse_mapinfo(k, v)));
if (!handled)
- LOG_WARNINGF("Invalid gametype setting in mapinfo for gametype %s: %s\n", MapInfo_Type_ToString(pWantedType), sa);
+ LOG_MAPWARNF("Invalid gametype setting in mapinfo for gametype %s: %s\n", MapInfo_Type_ToString(pWantedType), sa);
}
if (pWantedType == MAPINFO_TYPE_RACE && cvar("g_race_teams") >= 2)
#define deprecate(from, to) MACRO_BEGIN { \
if (t == #from) { \
string replacement = #to; \
- LOG_WARNINGF("MapInfo_Type_FromString (probably %s): using deprecated name '%s'. Should use '%s'.\n", MapInfo_Map_bspname, t, replacement); \
+ LOG_MAPWARNF("MapInfo_Type_FromString (probably %s): using deprecated name '%s'. Should use '%s'.\n", MapInfo_Map_bspname, t, replacement); \
t = replacement; \
} \
} MACRO_END
{
fh = fopen(s, FILE_READ);
if(fh < 0)
- LOG_INFO("Map ", pFilename, " references not existing config file ", s, "\n");
+ LOG_MAPWARN("Map ", pFilename, " references not existing config file ", s, "\n");
else
{
for (;;)
}
}
else
- LOG_INFO("Map ", pFilename, " uses too many levels of inclusion\n");
+ LOG_MAPWARN("Map ", pFilename, " uses too many levels of inclusion\n");
}
else if(t == "")
- LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if (!cvar_value_issafe(t))
- LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if (!cvar_value_issafe(s))
- LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
- LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if(matchacl(acl, t) <= 0)
- LOG_INFO("Map ", pFilename, " contains a denied setting, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a denied setting, ignored\n");
else
{
if(type == 0) // server set
if(strstrofs(pFilename, "/", 0) >= 0)
{
- LOG_INFO("Invalid character in map name, ignored\n");
+ LOG_MAPWARN("Invalid character in map name, ignored\n");
return 0;
}
error("... but I just wrote it!");
}
- LOG_INFO("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
+ LOG_MAPWARN("autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
}
_MapInfo_Map_Reset();
else if(t == "monsters") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_MONSTERS;
else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
else
- LOG_TRACE("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
}
else if(t == "hidden")
{
{
t = car(s); s = cdr(s);
f = MapInfo_Type_FromString(t);
- LOG_WARNING("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
+ LOG_MAPWARN("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
if(f)
_MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, true);
else
- LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
}
else if(t == "gametype")
{
if(f)
_MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
else
- LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
}
else if(t == "size")
{
t = car(s); s = cdr(s); d = stof(t);
t = car(s); s = cdr(s); e = stof(t);
if(s == "")
- LOG_INFO("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+ LOG_MAPWARN("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
else
{
t = car(s); s = cdr(s); f = stof(t);
if(s != "")
- LOG_INFO("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+ LOG_MAPWARN("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
else
{
if(a >= d || b >= e || c >= f)
- LOG_INFO("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
+ LOG_MAPWARN("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
else
{
MapInfo_Map_mins.x = a;
}
else
{
- LOG_TRACE("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
}
}
else if(t == "clientsettemp_for_type")
}
else
{
- LOG_TRACE("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
}
}
else if(t == "fog")
{
if (!cvar_value_issafe(s))
- LOG_INFO("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
else
MapInfo_Map_fog = s;
}
if(pGametypeToSet)
{
if (!cvar_value_issafe(t))
- LOG_INFO("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
else
MapInfo_Map_clientstuff = strcat(
MapInfo_Map_clientstuff, "cd loop \"", t, "\"\n"
}
}
else
- LOG_TRACE("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
}
fclose(fh);
MapInfo_Cache_Store();
if(MapInfo_Map_supportedGametypes != 0)
return r;
- LOG_TRACE("Map ", pFilename, " supports no game types, ignored\n");
+ LOG_MAPWARN("Map ", pFilename, " supports no game types, ignored\n");
return 0;
}
float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, int pGametypeToSet)
{
if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break"))
{
- LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
+ LOG_SEVERE("can't play the selected map in the given game mode. Working with only the override settings.\n");
_MapInfo_Map_ApplyGametypeEx("", t, t);
return; // do not call Get_ByName!
}
if(MapInfo_Map_supportedGametypes == 0)
{
- LOG_INFO("Mapinfo system is not functional at all. Assuming deathmatch.\n");
+ LOG_SEVERE("Mapinfo system is not functional at all. Assuming deathmatch.\n");
MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH;
MapInfo_LoadMapSettings_SaveGameType(MAPINFO_TYPE_DEATHMATCH);
_MapInfo_Map_ApplyGametypeEx("", MAPINFO_TYPE_DEATHMATCH, MAPINFO_TYPE_DEATHMATCH);
}
// t is now a supported mode!
- LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
+ LOG_WARNING("can't play the selected map in the given game mode. Falling back to a supported mode.\n");
MapInfo_LoadMapSettings_SaveGameType(t);
}
MapInfo_Get_ByName(s, 1, t);