+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 max_attempts = available_maps;
+ if (available_maps >= 2)
+ max_attempts = min(available_maps * 5, 100);
+
+ if (smax && mapvote_suggestion_ptr)
+ for(int i = 0; i < max_attempts && mapvote_count < smax; ++i)
+ MapVote_AddVotable(mapvote_suggestions[floor(random() * mapvote_suggestion_ptr)], true);
+
+ for (int i = 0; i < max_attempts && mapvote_count < nmax; ++i)
+ MapVote_AddVotable(GetNextMap(), false);
+}
+