// sv_vote_gametype_*_type Must be set to the name of the gametype the option is based on
// sv_vote_gametype_*_name Contains a human-readable name of the gametype
// sv_vote_gametype_*_description Contains a longer description
+// sv_vote_gametype_*_maplist Optional list of maps for the gametype
//set sv_vote_gametype_1v1ctf_type ctf
//set sv_vote_gametype_1v1ctf_name "Capture the Flag Duel"
//set sv_vote_gametype_1v1ctf_description "One vs One match in CTF"
// otherwise gametype_string is the string (short name) of a custom gametype
bool GameTypeVote_SetGametype(Gametype type, string gametype_string, bool call_hooks)
{
+ if (gametype_string == "")
+ gametype_string = MapInfo_Type_ToString(type);
if (!call_hooks)
{
// custom gametype is disabled because gametype hooks can't be executed
}
else
{
- if (gametype_string == "")
- gametype_string = MapInfo_Type_ToString(type);
gametype_custom_enabled = (gametype_string != MapInfo_Type_ToString(type));
localcmd("sv_vote_gametype_hook_all\n");
return false;
}
- cvar_set("g_maplist", MapInfo_ListAllowedMaps(type, MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()) );
+ bool doreset = autocvar_sv_vote_gametype_maplist_reset;
+ string gvmaplist = strcat("sv_vote_gametype_", gametype_string, "_maplist");
+ if(cvar_type(gvmaplist) & CVAR_TYPEFLAG_EXISTS)
+ {
+ // force a reset if the provided list is empty
+ if(cvar_string(gvmaplist) == "")
+ doreset = true;
+ else
+ cvar_set("g_maplist", cvar_string(gvmaplist));
+ }
+ if(doreset)
+ cvar_set("g_maplist", MapInfo_ListAllowedMaps(type, MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()) );
return true;
}
string autocvar_sv_vote_gametype_options;
float autocvar_sv_vote_gametype_keeptwotime;
bool autocvar_sv_vote_gametype_default_current;
+bool autocvar_sv_vote_gametype_maplist_reset = true;
// definitions for functions used outside mapvoting.qc
void MapVote_Start();
set sv_vote_gametype_options "dm tdm ca ctf" "identifiers of gamemodes on the voting screen, can be custom (max 9 chars) - see example in server/server.cfg"
set sv_vote_gametype_timeout 20 "how long the gametype vote screen lasts"
set sv_vote_gametype_default_current 1 "Keep the current gametype if no one votes"
+set sv_vote_gametype_maplist_reset 1 "Reset g_maplist when switching to a new gametype"
set g_chat_flood_spl 3 "normal chat: seconds between lines to not count as flooding"
set g_chat_flood_lmax 2 "normal chat: maximum number of lines per chat message at once"