return substring(out, 1, strlen(out) - 1);
}
+string MapInfo_ListAllAllowedMaps(float pRequiredFlags, float pForbiddenFlags)
+{
+ string out;
+ float i;
+
+ // to make absolutely sure:
+ MapInfo_Enumerate();
+ MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, pRequiredFlags, pForbiddenFlags, 0);
+
+ out = "";
+ for(i = 0; i < MapInfo_count; ++i)
+ out = strcat(out, " ", _MapInfo_GlobItem(MapInfo_FilterList_Lookup(i)));
+
+ MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0);
+
+ return substring(out, 1, strlen(out) - 1);
+}
+
void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
{
float t, t0;
// list all maps for the current game type
string MapInfo_ListAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
+// list all allowed maps (for any game type)
+string MapInfo_ListAllAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
// gets a gametype from a string
float MapInfo_Type_FromString(string t);
if(Map_Count == 0)
{
bprint( "Maplist is empty! Resetting it to default map list.\n" );
- cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
+ cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");
if(allowReset)
{
bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" );
- cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
+ cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");
if(mapvote_count == 0)
{
bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" );
- cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
+ cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
localcmd("\nmenu_cmd sync\n");