This flag was ignored in the code paths used on most servers, and its
name and behaviour were not ideal for its intended use, see
7d48e976c8a9b3f80350b2ad41d9feec2797cf76 description which seems clear
that it's for allowing a certain kind of map to be available on the
server but not be included in the usual voting pool.
This updated implementation omits the flagged maps from GUI voting and
prevents them being selected by other GotoNextMap()/GetNextMap() code
paths, unless there aren't enough viable maps in which case they
can still be used as fallbacks.
The flagged maps are always listed in CLI and may be nominated with
`suggestmap` or vcalled with `gotomap` or `nextmap`.
{
MapInfo_Map_flags |= MAPINFO_FLAG_FRUSTRATING;
}
- else if(t == "noautomaplist")
+ else if(t == "donotwant" || t == "noautomaplist")
{
- MapInfo_Map_flags |= MAPINFO_FLAG_NOAUTOMAPLIST;
+ MapInfo_Map_flags |= MAPINFO_FLAG_DONOTWANT;
}
else if(t == "gameversion_min")
{
if (cvar("gameversion") < stof(s))
- MapInfo_Map_flags |= MAPINFO_FLAG_NOAUTOMAPLIST;
+ MapInfo_Map_flags |= MAPINFO_FLAG_DONOTWANT;
}
else if(t == "type")
{
const int MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
const int MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps
const int MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk
-const int MAPINFO_FLAG_NOAUTOMAPLIST = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes)
+const int MAPINFO_FLAG_DONOTWANT = 8; // do not include in GUI voting screen or select in GotoNextMap()/GetNextMap(), unless added with `suggestmap` or required as a fallback
float MapInfo_count;
{
if(pass == 2)
return true;
+ // MapInfo_Map_flags was set by MapInfo_CheckMap()
+ if (MapInfo_Map_flags & MAPINFO_FLAG_DONOTWANT)
+ return false;
if(MapHasRightSize(map_next))
return true;
return false;
if (i == Map_Count)
{
bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" );
- cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST));
+ cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
if(autocvar_g_maplist_shuffle)
ShuffleMaplist();
if(!server_is_dedicated)