X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmapvoting.qc;fp=qcsrc%2Fserver%2Fmapvoting.qc;h=5ac9b0472f7bc9844cf5eb5cd4e99672c5714461;hb=01d975ef584acf1cfd3ecc739955ee10f916c75c;hp=c3ddeeea3ece91a6a0abbf6ed1ad39c1715b84b7;hpb=0a56f137a2821149693e7acafc28ff4e67b3fd60;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index c3ddeeea3..5ac9b0472 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -12,7 +12,6 @@ #include #include #include -#include #include // definitions @@ -203,16 +202,7 @@ void MapVote_AddVotable(string nextMap, bool isSuggestion) void MapVote_AddVotableMaps(int nmax, int smax) { - int available_maps = 0; - if (autocvar_g_maplist != "") - { - int c = tokenizebyseparator(autocvar_g_maplist, " "); - for (int i = 0; i < c; ++i) - { - if (Map_Check(i, 1) || Map_Check(i, 2)) - ++available_maps; - } - } + int available_maps = Maplist_Init(); int max_attempts = available_maps; if (available_maps >= 2) max_attempts = min(available_maps * 5, 100); @@ -252,16 +242,6 @@ void MapVote_Init() MapVote_AddVotableMaps(nmax, smax); - 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_CurrentGametype(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); - if(autocvar_g_maplist_shuffle) - ShuffleMaplist(); - localcmd("\nmenu_cmd sync\n"); - MapVote_AddVotableMaps(nmax, 0); - } - mapvote_count_real = mapvote_count; if(mapvote_abstain) MapVote_AddVotable("don't care", false); @@ -773,8 +753,6 @@ bool GameTypeVote_SetGametype(Gametype type) } cvar_set("g_maplist", MapInfo_ListAllowedMaps(type, MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()) ); - if(autocvar_g_maplist_shuffle) - ShuffleMaplist(); return true; }