// GLOB HANDLING (for all BSP files)
float _MapInfo_globopen;
-float _MapInfo_globcount;
+float _MapInfo_globcount;
float _MapInfo_globhandle;
string _MapInfo_GlobItem(float i)
{
float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate)
{
float i, j;
- if not(_MapInfo_filtered_allocated)
+ if (!_MapInfo_filtered_allocated)
{
_MapInfo_filtered_allocated = 1;
_MapInfo_filtered = buf_create();
}
MapInfo_count = j + 1;
MapInfo_ClearTemps();
-
+
// sometimes the glob isn't sorted nicely, so fix it here...
heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world);
for(;;)
{
- if not((s = fgets(fh)))
+ if (!((s = fgets(fh))))
break;
if(inWorldspawn == 1)
if(startsWith(s, "}"))
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTF;
else if(v == "team_CTF_blueflag")
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTF;
- else if(v == "runematch_spawn_point")
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_RUNEMATCH;
+ else if(v == "invasion_spawnpoint")
+ MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_INVASION;
else if(v == "target_assault_roundend")
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_ASSAULT;
else if(v == "onslaught_generator")
else
{
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_DEATHMATCH; // DM always works
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_RUNEMATCH; // Rune always works
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_LMS; // LMS always works
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEEPAWAY; // Keepaway always works
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG;
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA;
}
- if( diameter < 4096)
- MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_ARENA;
if(spawnpoints >= 12 && diameter > 5120)
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEYHUNT;
}
if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE)
if(!spawnplaces)
{
- MapInfo_Map_supportedGametypes &~= MAPINFO_TYPE_RACE;
+ MapInfo_Map_supportedGametypes &= ~MAPINFO_TYPE_RACE;
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS;
}
case MAPINFO_TYPE_TEAM_DEATHMATCH: return "50 20 2 0";
case MAPINFO_TYPE_DOMINATION: return "200 20 0";
case MAPINFO_TYPE_CTF: return "300 20 10 0";
- case MAPINFO_TYPE_RUNEMATCH: return "200 20 0";
case MAPINFO_TYPE_LMS: return "9 20 0";
- case MAPINFO_TYPE_ARENA: return "10 20 0";
case MAPINFO_TYPE_CA: return "10 20 0";
case MAPINFO_TYPE_KEYHUNT: return "1000 20 3 0";
case MAPINFO_TYPE_ASSAULT: return "20 0";
if(load_default)
_MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, FALSE);
-
+
if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
{
cvar_set("fraglimit", "0");
s = cdr(s);
}
+ if(pWantedType == MAPINFO_TYPE_CA)
+ {
+ sa = car(s);
+ if(sa != "")
+ cvar_set("g_ca_teams", sa);
+ s = cdr(s);
+ }
+
+ if(pWantedType == MAPINFO_TYPE_FREEZETAG)
+ {
+ sa = car(s);
+ if(sa != "")
+ cvar_set("g_freezetag_teams", sa);
+ s = cdr(s);
+ }
+
if(pWantedType == MAPINFO_TYPE_CTF)
{
sa = car(s);
s = cdr(s);
}
*/
-
+
// rc = timelimit timelimit_qualification laps laps_teamplay
if(pWantedType == MAPINFO_TYPE_RACE)
{
cvar_set("leadlimit", cvar_defstring("leadlimit"));
cvar_set("fraglimit", cvar_defstring("fraglimit"));
cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
+ cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
+ cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
cvar_set("g_domination_default_teams", cvar_defstring("g_domination_default_teams"));
cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
else if(k == "teams")
{
cvar_set("g_tdm_teams", v);
+ cvar_set("g_ca_teams", v);
+ cvar_set("g_freezetag_teams", v);
cvar_set("g_keyhunt_teams", v);
cvar_set("g_domination_default_teams", v);
}
t = "ka";
print("'. Should use '", t, "'.\n");
}
+ if(t == "invasion")
+ {
+ print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ t = "inv";
+ print("'. Should use '", t, "'.\n");
+ }
if(t == "all")
return MAPINFO_TYPE_ALL;
for(e = MapInfo_Type_first; e; e = e.enemy)
string MapInfo_Type_ToString(float t)
{
entity e;
- if(t == MAPINFO_TYPE_ALL)
+ if(t == MAPINFO_TYPE_ALL)
return "all";
for(e = MapInfo_Type_first; e; e = e.enemy)
if(t == e.items)
for(e = MapInfo_Type_first; e; e = e.enemy)
if(t == e.items)
return e.message;
+ /* xgettext:no-c-format */
return _("@!#%'n Tuba Throwing");
}
o = strstrofs(s, "\"", 0);
if(o >= 0)
s = substring(s, 0, o);
-
+
// remove // comments
o = strstrofs(s, "//", 0);
if(o >= 0)
s = substring(s, 0, o);
-
+
// remove trailing spaces
while(substring(s, -1, 1) == " ")
s = substring(s, 0, -2);
{
for(;;)
{
- if not((s = fgets(fh)))
+ if (!((s = fgets(fh))))
break;
// catch different sorts of comments
}
else if(t == "")
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
- else if not(cvar_value_issafe(t))
+ else if (!cvar_value_issafe(t))
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
- else if not (cvar_value_issafe(s))
+ else if (!cvar_value_issafe(s))
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else
fputs(fh, "// uncomment this if you added turrets: has turrets\n");
if(MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_VEHICLES)
- fputs(fh, "has weapons\n");
+ fputs(fh, "has vehicles\n");
else
fputs(fh, "// uncomment this if you added vehicles: has vehicles\n");
if(MapInfo_Map_flags & MAPINFO_FLAG_FRUSTRATING)
_MapInfo_Map_Reset();
for(;;)
{
- if not((s = fgets(fh)))
+ if (!((s = fgets(fh))))
break;
// catch different sorts of comments
{
MapInfo_Map_flags |= MAPINFO_FLAG_FRUSTRATING;
}
+ else if(t == "noautomaplist")
+ {
+ MapInfo_Map_flags |= MAPINFO_FLAG_NOAUTOMAPLIST;
+ }
else if(t == "type")
{
t = car(s); s = cdr(s);
}
else if(t == "fog")
{
- if not(cvar_value_issafe(t))
+ if (!cvar_value_issafe(s))
print("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
else
MapInfo_Map_fog = s;
}
else if(t == "cdtrack")
{
- if(pGametypeToSet)
+ t = car(s); s = cdr(s);
+ if(pGametypeToSet) // FIXME is this check right here?
{
- if not(cvar_value_issafe(t))
+ if (!cvar_value_issafe(t))
print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
else
MapInfo_Map_clientstuff = strcat(
- MapInfo_Map_clientstuff, "cd loop \"", s, "\"\n"
+ MapInfo_Map_clientstuff, "cd loop \"", t, "\"\n"
);
}
}
if(cvar("g_tdm_on_dm_maps"))
{
// if this is set, all DM maps support TDM too
- if not(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH)
+ if (!(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH))
if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH)
_MapInfo_Map_ApplyGametypeEx ("", pGametypeToSet, MAPINFO_TYPE_TEAM_DEATHMATCH);
}
// print("EMERGENCY: can't play the selected map in the given game mode. Falling back to DM.\n");
// MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH);
//}
-
+
cvar_settemp_restore();
if(reinit)
localcmd(strcat("\nmap ", s, "\n"));
f = MAPINFO_FLAG_FORBIDDEN;
#ifndef MENUQC
- if not(cvar("g_maplist_allow_hidden"))
+ if (!cvar("g_maplist_allow_hidden"))
#endif
f |= MAPINFO_FLAG_HIDDEN;
- if not(cvar("g_maplist_allow_frustrating"))
+ if (!cvar("g_maplist_allow_frustrating"))
f |= MAPINFO_FLAG_FRUSTRATING;
return f;