5 // info about a map that MapInfo loads
6 string MapInfo_Map_bspname;
7 string MapInfo_Map_title;
8 string MapInfo_Map_titlestring; // either bspname: title or just title, depending on whether bspname is redundant
9 string MapInfo_Map_description;
10 string MapInfo_Map_author;
11 string MapInfo_Map_clientstuff; // not in cache, only for map load
12 string MapInfo_Map_fog; // not in cache, only for map load
13 int MapInfo_Map_supportedGametypes;
14 int MapInfo_Map_supportedFeatures;
15 int MapInfo_Map_flags;
16 vector MapInfo_Map_mins; // these are '0 0 0' if not supported!
17 vector MapInfo_Map_maxs; // these are '0 0 0' if not specified!
22 CLASS(Gametype, Object)
23 ATTRIB(Gametype, m_id, int, 0);
25 ATTRIB(Gametype, items, int, 0);
26 /** game type name as in cvar (with g_ prefix) */
27 ATTRIB(Gametype, netname, string);
28 /** game type short name */
29 ATTRIB(Gametype, mdl, string);
30 /** human readable name */
31 ATTRIB(Gametype, message, string);
32 /** does this gametype support teamplay? */
33 ATTRIB(Gametype, team, bool, false);
34 /** does this gametype use a point limit? */
35 ATTRIB(Gametype, frags, bool, true);
36 /** game type defaults */
37 ATTRIB(Gametype, model2, string);
38 /** game type description */
39 ATTRIB(Gametype, gametype_description, string);
41 ATTRIB(Gametype, m_modicons, void(vector pos, vector mySize));
42 ATTRIB(Gametype, m_modicons_reset, void());
45 /** DO NOT USE, this is compatibility for legacy maps! */
46 ATTRIB(Gametype, m_legacydefaults, string, "");
48 ATTRIB(Gametype, m_mutators, string);
49 METHOD(Gametype, m_parse_mapinfo, bool(string k, string v))
53 METHOD(Gametype, m_generate_mapinfo, void(Gametype this, string v))
57 METHOD(Gametype, m_isTwoBaseMode, bool())
61 METHOD(Gametype, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
65 METHOD(Gametype, m_isForcedSupported, bool(Gametype this))
69 METHOD(Gametype, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
72 returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", string_null, _("The amount of frags needed before the match will end"));
75 METHOD(Gametype, describe, string(Gametype this))
78 return this.gametype_description;
81 METHOD(Gametype, display, void(Gametype this, void(string name, string icon) returns))
84 returns(this.message, strcat("gametype_", this.mdl));
87 METHOD(Gametype, gametype_init, void(Gametype this, string hname, string sname, string g_name, bool gteamplay, bool gusepoints, string mutators, string defaults, string gdescription))
89 this.netname = g_name;
92 this.team = gteamplay;
93 this.m_mutators = cons(sname, mutators);
94 this.model2 = defaults;
95 this.gametype_description = gdescription;
96 this.frags = gusepoints;
98 // same as `1 << m_id`
99 MAPINFO_TYPE_ALL |= this.items = this.m_flags = (MAPINFO_TYPE_ALL + 1);
103 REGISTRY(Gametypes, 24)
104 REGISTER_REGISTRY(Gametypes)
105 REGISTRY_CHECK(Gametypes)
107 REGISTRY_DEFINE_GET(Gametypes, NULL)
108 #define REGISTER_GAMETYPE(NAME, inst) REGISTER(Gametypes, MAPINFO_TYPE, NAME, m_id, inst)
110 #define IS_GAMETYPE(NAME) (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
112 CLASS(Deathmatch, Gametype)
115 this.gametype_init(this, _("Deathmatch"),"dm","g_dm",false,true,"","timelimit=15 pointlimit=30 leadlimit=0",_("Score as many frags as you can"));
117 METHOD(Deathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
121 ATTRIB(Deathmatch, m_legacydefaults, string, "30 20 0");
123 REGISTER_GAMETYPE(DEATHMATCH, NEW(Deathmatch));
125 CLASS(LastManStanding, Gametype)
126 INIT(LastManStanding)
128 this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",false,true,"","timelimit=20 lives=5 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
130 METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
134 METHOD(LastManStanding, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
137 returns(menu, _("Lives:"), 3, 50, 1, "g_lms_lives_override", string_null, string_null);
139 ATTRIB(LastManStanding, m_legacydefaults, string, "9 20 0");
140 ENDCLASS(LastManStanding)
141 REGISTER_GAMETYPE(LMS, NEW(LastManStanding));
144 void HUD_Mod_Race(vector pos, vector mySize);
146 CLASS(Race, Gametype)
149 this.gametype_init(this, _("Race"),"rc","g_race",false,true,"","timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
151 METHOD(Race, m_parse_mapinfo, bool(string k, string v))
154 cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
158 case "qualifying_timelimit":
159 cvar_set("g_race_qualifying_timelimit", v);
164 METHOD(Race, m_generate_mapinfo, void(Gametype this, string v))
166 if(v == "trigger_race_checkpoint")
167 MapInfo_Map_supportedGametypes |= this.m_flags;
169 METHOD(Race, m_isTwoBaseMode, bool())
173 METHOD(Race, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
176 returns(menu, _("Laps:"), 1, 25, 1, "g_race_laps_limit", string_null, string_null);
179 ATTRIB(Race, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
181 ATTRIB(Race, m_legacydefaults, string, "20 5 7 15 0");
183 REGISTER_GAMETYPE(RACE, NEW(Race));
184 #define g_race IS_GAMETYPE(RACE)
186 CLASS(RaceCTS, Gametype)
189 this.gametype_init(this, _("Race CTS"),"cts","g_cts",false,false,"cloaked","timelimit=20",_("Race for fastest time."));
191 METHOD(RaceCTS, m_generate_mapinfo, void(Gametype this, string v))
193 if(v == "target_startTimer")
194 MapInfo_Map_supportedGametypes |= this.m_flags;
196 METHOD(RaceCTS, m_setTeams, void(string sa))
198 // this is the skill of the map
199 // not parsed by anything yet
201 // cvar_set("fraglimit", sa);
203 METHOD(RaceCTS, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
206 returns(menu, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null);
209 ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
211 ATTRIB(RaceCTS, m_legacydefaults, string, "20 0 0");
213 REGISTER_GAMETYPE(CTS, NEW(RaceCTS));
214 #define g_cts IS_GAMETYPE(CTS)
216 CLASS(TeamDeathmatch, Gametype)
219 this.gametype_init(this, _("Team Deathmatch"),"tdm","g_tdm",true,true,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Help your team score the most frags against the enemy team"));
221 METHOD(TeamDeathmatch, m_parse_mapinfo, bool(string k, string v))
224 cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
229 cvar_set("g_tdm_teams", v);
234 METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
236 if(spawnpoints >= 8 && diameter > 4096)
240 METHOD(TeamDeathmatch, m_isForcedSupported, bool(Gametype this))
242 if(cvar("g_tdm_on_dm_maps"))
244 // if this is set, all DM maps support TDM too
245 if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
246 return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
250 METHOD(TeamDeathmatch, m_setTeams, void(string sa))
252 cvar_set("g_tdm_teams", sa);
254 METHOD(TeamDeathmatch, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
257 returns(menu, _("Point limit:"), 5, 100, 5, "g_tdm_point_limit", "g_tdm_teams_override", _("The amount of points needed before the match will end"));
259 ATTRIB(TeamDeathmatch, m_legacydefaults, string, "50 20 2 0");
260 ENDCLASS(TeamDeathmatch)
261 REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
262 #define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
265 void HUD_Mod_CTF(vector pos, vector mySize);
266 void HUD_Mod_CTF_Reset();
268 CLASS(CaptureTheFlag, Gametype)
271 this.gametype_init(this, _("Capture the Flag"),"ctf","g_ctf",true,true,"","timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it, defend your base from the other team"));
273 METHOD(CaptureTheFlag, m_generate_mapinfo, void(Gametype this, string v))
275 if(v == "item_flag_team2" || v == "team_CTF_blueflag")
276 MapInfo_Map_supportedGametypes |= this.m_flags;
278 METHOD(CaptureTheFlag, m_isTwoBaseMode, bool())
282 METHOD(CaptureTheFlag, m_setTeams, void(string sa))
284 cvar_set("fraglimit", sa);
286 METHOD(CaptureTheFlag, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
289 returns(menu, _("Capture limit:"), 1, 20, 1, "capturelimit_override", string_null, _("The amount of captures needed before the match will end"));
292 ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
293 ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
295 ATTRIB(CaptureTheFlag, m_legacydefaults, string, "300 20 10 0");
296 ENDCLASS(CaptureTheFlag)
297 REGISTER_GAMETYPE(CTF, NEW(CaptureTheFlag));
298 #define g_ctf IS_GAMETYPE(CTF)
301 void HUD_Mod_CA(vector pos, vector mySize);
303 CLASS(ClanArena, Gametype)
306 this.gametype_init(this, _("Clan Arena"),"ca","g_ca",true,true,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill all enemy teammates to win the round"));
308 METHOD(ClanArena, m_parse_mapinfo, bool(string k, string v))
311 cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
316 cvar_set("g_ca_teams", v);
321 METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
323 if(spawnpoints >= 8 && diameter > 4096)
327 METHOD(ClanArena, m_setTeams, void(string sa))
329 cvar_set("g_ca_teams", sa);
331 METHOD(ClanArena, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
334 returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_ca_teams_override", _("The amount of frags needed before the match will end"));
337 ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
339 ATTRIB(ClanArena, m_legacydefaults, string, "10 20 0");
341 REGISTER_GAMETYPE(CA, NEW(ClanArena));
342 #define g_ca IS_GAMETYPE(CA)
345 void HUD_Mod_Dom(vector pos, vector mySize);
347 CLASS(Domination, Gametype)
350 this.gametype_init(this, _("Domination"),"dom","g_domination",true,true,"","timelimit=20 pointlimit=200 teams=2 leadlimit=0",_("Capture and defend all the control points to win"));
352 METHOD(Domination, m_parse_mapinfo, bool(string k, string v))
355 cvar_set("g_domination_default_teams", cvar_defstring("g_domination_default_teams"));
360 cvar_set("g_domination_default_teams", v);
365 METHOD(Domination, m_generate_mapinfo, void(Gametype this, string v))
367 if(v == "dom_controlpoint")
368 MapInfo_Map_supportedGametypes |= this.m_flags;
370 METHOD(Domination, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
373 returns(menu, _("Point limit:"), 50, 500, 10, "g_domination_point_limit", "g_domination_teams_override", _("The amount of points needed before the match will end"));
376 ATTRIB(Domination, m_modicons, void(vector pos, vector mySize), HUD_Mod_Dom);
378 ATTRIB(Domination, m_legacydefaults, string, "200 20 0");
380 REGISTER_GAMETYPE(DOMINATION, NEW(Domination));
383 void HUD_Mod_KH(vector pos, vector mySize);
385 CLASS(KeyHunt, Gametype)
388 this.gametype_init(this, _("Key Hunt"),"kh","g_keyhunt",true,true,"","timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
390 METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v))
393 cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
398 cvar_set("g_keyhunt_teams", v);
403 METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
405 if(spawnpoints >= 12 && diameter > 5120)
409 METHOD(KeyHunt, m_setTeams, void(string sa))
411 cvar_set("g_keyhunt_teams", sa);
413 METHOD(KeyHunt, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
416 returns(menu, _("Point limit:"), 200, 1500, 50, "g_keyhunt_point_limit", "g_keyhunt_teams_override", _("The amount of points needed before the match will end"));
419 ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
421 ATTRIB(KeyHunt, m_legacydefaults, string, "1000 20 3 0");
423 REGISTER_GAMETYPE(KEYHUNT, NEW(KeyHunt));
425 CLASS(Assault, Gametype)
428 this.gametype_init(this, _("Assault"),"as","g_assault",true,false,"","timelimit=20",_("Destroy obstacles to find and destroy the enemy power core before time runs out"));
430 METHOD(Assault, m_generate_mapinfo, void(Gametype this, string v))
432 if(v == "target_assault_roundend")
433 MapInfo_Map_supportedGametypes |= this.m_flags;
435 METHOD(Assault, m_isTwoBaseMode, bool())
439 METHOD(Assault, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
442 returns(menu, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null);
444 ATTRIB(Assault, m_legacydefaults, string, "20 0");
446 REGISTER_GAMETYPE(ASSAULT, NEW(Assault));
447 #define g_assault IS_GAMETYPE(ASSAULT)
449 CLASS(Onslaught, Gametype)
452 this.gametype_init(this, _("Onslaught"),"ons","g_onslaught",true,false,"","pointlimit=1 timelimit=20",_("Capture control points to reach and destroy the enemy generator"));
454 METHOD(Onslaught, m_generate_mapinfo, void(Gametype this, string v))
456 if(v == "onslaught_generator")
457 MapInfo_Map_supportedGametypes |= this.m_flags;
459 METHOD(Onslaught, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
462 returns(menu, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null);
464 ATTRIB(Onslaught, m_legacydefaults, string, "20 0");
466 REGISTER_GAMETYPE(ONSLAUGHT, NEW(Onslaught));
469 void HUD_Mod_NexBall(vector pos, vector mySize);
471 CLASS(NexBall, Gametype)
474 this.gametype_init(this, _("Nexball"),"nb","g_nexball",true,true,"","timelimit=20 pointlimit=5 leadlimit=0",_("Shoot and kick the ball into the enemies goal, keep your goal clean"));
476 METHOD(NexBall, m_generate_mapinfo, void(Gametype this, string v))
478 if(substring(v, 0, 8) == "nexball_" || substring(v, 0, 4) == "ball")
479 MapInfo_Map_supportedGametypes |= this.m_flags;
481 METHOD(NexBall, m_isTwoBaseMode, bool())
485 METHOD(NexBall, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
488 returns(menu, _("Goals:"), 1, 50, 1, "g_nexball_goallimit", string_null, _("The amount of goals needed before the match will end"));
491 ATTRIB(NexBall, m_modicons, void(vector pos, vector mySize), HUD_Mod_NexBall);
493 ATTRIB(NexBall, m_legacydefaults, string, "5 20 0");
495 REGISTER_GAMETYPE(NEXBALL, NEW(NexBall));
496 #define g_nexball IS_GAMETYPE(NEXBALL)
498 CLASS(FreezeTag, Gametype)
501 this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",true,true,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
503 METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
506 cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
511 cvar_set("g_freezetag_teams", v);
516 METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
518 if(spawnpoints >= 8 && diameter > 4096)
522 METHOD(FreezeTag, m_setTeams, void(string sa))
524 cvar_set("g_freezetag_teams", sa);
526 METHOD(FreezeTag, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
529 returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_freezetag_teams_override", _("The amount of frags needed before the match will end"));
532 ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
534 ATTRIB(FreezeTag, m_legacydefaults, string, "10 20 0");
536 REGISTER_GAMETYPE(FREEZETAG, NEW(FreezeTag));
537 #define g_freezetag IS_GAMETYPE(FREEZETAG)
540 void HUD_Mod_Keepaway(vector pos, vector mySize);
542 CLASS(Keepaway, Gametype)
545 this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",false,true,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
547 METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
552 ATTRIB(Keepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_Keepaway);
555 REGISTER_GAMETYPE(KEEPAWAY, NEW(Keepaway));
557 CLASS(Invasion, Gametype)
560 this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,true,"","pointlimit=50 type=0",_("Survive against waves of monsters"));
562 METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
566 cvar_set("g_invasion_type", v);
571 METHOD(Invasion, m_generate_mapinfo, void(Gametype this, string v))
573 if(v == "invasion_spawnpoint")
574 MapInfo_Map_supportedGametypes |= this.m_flags;
576 METHOD(Invasion, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
579 returns(menu, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null);
582 REGISTER_GAMETYPE(INVASION, NEW(Invasion));
584 CLASS(Duel, Gametype)
587 this.gametype_init(this, _("Duel"),"duel","g_duel",false,true,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner"));
589 METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
591 return (diameter < 16384);
593 METHOD(Duel, m_isForcedSupported, bool(Gametype this))
595 if(!cvar("g_duel_not_dm_maps"))
597 // if this is set, all DM maps support duel too
598 // TODO: we should really check the size of maps, some DM maps do not work for duel!
599 if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
600 return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
605 REGISTER_GAMETYPE(DUEL, NEW(Duel));
606 #define g_duel IS_GAMETYPE(DUEL)
608 const int MAPINFO_FEATURE_WEAPONS = 1; // not defined for instagib-only maps
609 const int MAPINFO_FEATURE_VEHICLES = 2;
610 const int MAPINFO_FEATURE_TURRETS = 4;
611 const int MAPINFO_FEATURE_MONSTERS = 8;
613 const int MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
614 const int MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps
615 const int MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk
616 const int MAPINFO_FLAG_NOAUTOMAPLIST = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes)
620 // load MapInfo_count; generate mapinfo for maps that miss them, and clear the
621 // cache; you need to call MapInfo_FilterGametype afterwards!
622 void MapInfo_Enumerate();
624 // filter the info by game type mask (updates MapInfo_count)
625 float MapInfo_progress;
626 float MapInfo_FilterGametype(Gametype gametypeFlags, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
627 float _MapInfo_FilterGametype(int gametypeFlags, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
628 void MapInfo_FilterString(string sf); // filter _MapInfo_filtered (created by MapInfo_FilterGametype) with keyword
629 int MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
630 Gametype MapInfo_CurrentGametype(); // retrieves current gametype from cvars
631 int MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
632 int MapInfo_RequiredFlags(); // retrieves current flags from cvars
634 // load info about the i-th map into the MapInfo_Map_* globals
635 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
636 string MapInfo_BSPName_ByID(float i);
638 // load info about a map by name into the MapInfo_Map_* globals
639 int MapInfo_Get_ByName(string s, float allowGenerate, Gametype gametypeToSet); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file
641 // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match
642 string MapInfo_FindName_match; // the name of the map that was found
643 float MapInfo_FindName_firstResult; // -1 if none were found, index of first one if not unique but found (FindName then returns -1)
644 float MapInfo_FindName(string s);
645 string MapInfo_FixName(string s);
648 float MapInfo_CheckMap(string s); // returns 0 if the map can't be played with the current settings
649 void MapInfo_LoadMap(string s, float reinit);
651 // list all maps for the current game type
652 string MapInfo_ListAllowedMaps(Gametype type, float pFlagsRequired, float pFlagsForbidden);
653 // list all allowed maps (for any game type)
654 string MapInfo_ListAllAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
656 // gets a gametype from a string
657 string _MapInfo_GetDefaultEx(Gametype t);
658 float _MapInfo_GetTeamPlayBool(Gametype t);
659 Gametype MapInfo_Type_FromString(string t);
660 string MapInfo_Type_Description(Gametype t);
661 string MapInfo_Type_ToString(Gametype t);
662 string MapInfo_Type_ToText(Gametype t);
663 void MapInfo_SwitchGameType(Gametype t);
665 // to be called from worldspawn to set up cvars
666 void MapInfo_LoadMapSettings(string s);
667 Gametype MapInfo_LoadedGametype; // game type that was active during map load
669 void MapInfo_Cache_Destroy(); // disable caching
670 void MapInfo_Cache_Create(); // enable caching
671 void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
673 void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, float recurse);
675 void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
677 void MapInfo_Shutdown(); // call this in the shutdown handler
679 #define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
680 #define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* -r_water +*"