1 #include "mapvoting.qh"
3 #include <common/constants.qh>
4 #include <common/mapinfo.qh>
5 #include <common/net_linked.qh>
6 #include <common/playerstats.qh>
7 #include <common/state.qh>
8 #include <common/stats.qh>
9 #include <common/util.qh>
10 #include <common/weapons/_all.qh>
11 #include <server/client.qh>
12 #include <server/command/cmd.qh>
13 #include <server/command/getreplies.qh>
14 #include <server/gamelog.qh>
15 #include <server/intermission.qh>
16 #include <server/world.qh>
20 float mapvote_nextthink;
21 float mapvote_keeptwotime;
22 float mapvote_timeout;
23 const int MAPVOTE_SCREENSHOT_DIRS_COUNT = 4;
24 string mapvote_screenshot_dirs[MAPVOTE_SCREENSHOT_DIRS_COUNT];
25 int mapvote_screenshot_dirs_count;
28 int mapvote_count_real;
29 string mapvote_maps[MAPVOTE_COUNT];
30 int mapvote_maps_screenshot_dir[MAPVOTE_COUNT];
31 string mapvote_maps_pakfile[MAPVOTE_COUNT];
32 bool mapvote_maps_suggested[MAPVOTE_COUNT];
33 string mapvote_suggestions[MAPVOTE_COUNT];
34 int mapvote_suggestion_ptr;
36 int mapvote_selections[MAPVOTE_COUNT];
37 int mapvote_maps_flags[MAPVOTE_COUNT];
46 * Returns the gamtype ID from its name, if type_name isn't a real gametype it
47 * checks for sv_vote_gametype_(type_name)_type
49 Gametype GameTypeVote_Type_FromString(string type_name)
51 Gametype type = MapInfo_Type_FromString(type_name, false, false);
53 type = MapInfo_Type_FromString(cvar_string(
54 strcat("sv_vote_gametype_",type_name,"_type")), false, false);
58 int GameTypeVote_AvailabilityStatus(string type_name)
60 int flag = GTV_FORBIDDEN;
62 Gametype type = MapInfo_Type_FromString(type_name, false, false);
65 type = MapInfo_Type_FromString(cvar_string(
66 strcat("sv_vote_gametype_",type_name,"_type")), false, false);
73 if ( autocvar_nextmap != "" )
75 if ( !MapInfo_Get_ByName(autocvar_nextmap, false, NULL) )
77 if (!(MapInfo_Map_supportedGametypes & type.m_flags))
81 return flag | GTV_AVAILABLE;
84 int GameTypeVote_GetMask()
86 int n, j, gametype_mask;
87 n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " ");
88 n = min(MAPVOTE_COUNT, n);
90 for(j = 0; j < n; ++j)
91 gametype_mask |= GameTypeVote_Type_FromString(argv(j)).m_flags;
95 string GameTypeVote_MapInfo_FixName(string m)
97 if ( autocvar_sv_vote_gametype )
100 _MapInfo_FilterGametype(GameTypeVote_GetMask(), 0, MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
102 return MapInfo_FixName(m);
105 void MapVote_ClearAllVotes()
107 FOREACH_CLIENT(true, { it.mapvote = 0; });
110 void MapVote_UnzoneStrings()
112 for(int j = 0; j < mapvote_count; ++j)
114 strfree(mapvote_maps[j]);
115 strfree(mapvote_maps_pakfile[j]);
119 string MapVote_Suggest(entity this, string m)
123 return "That's not how to use this command.";
124 if(!autocvar_g_maplist_votable_suggestions)
125 return "Suggestions are not accepted on this server.";
126 if(mapvote_initialized)
128 return "Can't suggest - voting is already in progress!";
129 m = GameTypeVote_MapInfo_FixName(m);
131 return "The map you suggested is not available on this server.";
132 if(!autocvar_g_maplist_votable_suggestions_override_mostrecent)
134 return "This server does not allow for recent maps to be played again. Please be patient for some rounds.";
136 if (!autocvar_sv_vote_gametype)
137 if(!MapInfo_CheckMap(m))
138 return "The map you suggested does not support the current game mode.";
139 for(i = 0; i < mapvote_suggestion_ptr; ++i)
140 if(mapvote_suggestions[i] == m)
141 return "This map was already suggested.";
142 if(mapvote_suggestion_ptr >= MAPVOTE_COUNT)
144 i = floor(random() * mapvote_suggestion_ptr);
148 i = mapvote_suggestion_ptr;
149 mapvote_suggestion_ptr += 1;
151 if(mapvote_suggestions[i] != "")
152 strunzone(mapvote_suggestions[i]);
153 mapvote_suggestions[i] = strzone(m);
154 if(autocvar_sv_eventlog)
155 GameLogEcho(strcat(":vote:suggested:", m, ":", ftos(this.playerid)));
156 return strcat("Suggestion of ", m, " accepted.");
159 void MapVote_AddVotable(string nextMap, bool isSuggestion)
162 string pakfile, mapfile;
166 for(j = 0; j < mapvote_count; ++j)
167 if(mapvote_maps[j] == nextMap)
169 // suggestions might be no longer valid/allowed after gametype switch!
171 if(!MapInfo_CheckMap(nextMap))
173 mapvote_maps[mapvote_count] = strzone(nextMap);
174 mapvote_maps_suggested[mapvote_count] = isSuggestion;
176 pakfile = string_null;
177 for(i = 0; i < mapvote_screenshot_dirs_count; ++i)
179 mapfile = strcat(mapvote_screenshot_dirs[i], "/", nextMap);
180 pakfile = whichpack(strcat(mapfile, ".tga"));
182 pakfile = whichpack(strcat(mapfile, ".jpg"));
184 pakfile = whichpack(strcat(mapfile, ".png"));
188 if(i >= mapvote_screenshot_dirs_count)
189 i = 0; // FIXME maybe network this error case, as that means there is no mapshot on the server?
190 for(o = strstrofs(pakfile, "/", 0)+1; o > 0; o = strstrofs(pakfile, "/", 0)+1)
191 pakfile = substring(pakfile, o, -1);
193 mapvote_maps_screenshot_dir[mapvote_count] = i;
194 mapvote_maps_pakfile[mapvote_count] = strzone(pakfile);
195 mapvote_maps_flags[mapvote_count] = GTV_AVAILABLE;
205 MapVote_ClearAllVotes();
206 MapVote_UnzoneStrings();
209 mapvote_detail = !autocvar_g_maplist_votable_nodetail;
210 mapvote_abstain = boolean(autocvar_g_maplist_votable_abstain);
213 nmax = min(MAPVOTE_COUNT - 1, autocvar_g_maplist_votable);
215 nmax = min(MAPVOTE_COUNT, autocvar_g_maplist_votable);
216 smax = min3(nmax, autocvar_g_maplist_votable_suggestions, mapvote_suggestion_ptr);
218 // we need this for AddVotable, as that cycles through the screenshot dirs
219 mapvote_screenshot_dirs_count = tokenize_console(autocvar_g_maplist_votable_screenshot_dir);
220 if(mapvote_screenshot_dirs_count == 0)
221 mapvote_screenshot_dirs_count = tokenize_console("maps levelshots");
222 mapvote_screenshot_dirs_count = min(mapvote_screenshot_dirs_count, MAPVOTE_SCREENSHOT_DIRS_COUNT);
223 for(i = 0; i < mapvote_screenshot_dirs_count; ++i)
224 mapvote_screenshot_dirs[i] = strzone(argv(i));
226 if(mapvote_suggestion_ptr)
227 for(i = 0; i < 100 && mapvote_count < smax; ++i)
228 MapVote_AddVotable(mapvote_suggestions[floor(random() * mapvote_suggestion_ptr)], true);
230 for(i = 0; i < 100 && mapvote_count < nmax; ++i)
231 MapVote_AddVotable(GetNextMap(), false);
233 if(mapvote_count == 0)
235 bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" );
236 cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_CurrentGametype(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
237 if(autocvar_g_maplist_shuffle)
239 localcmd("\nmenu_cmd sync\n");
240 for(i = 0; i < 100 && mapvote_count < nmax; ++i)
241 MapVote_AddVotable(GetNextMap(), false);
244 mapvote_count_real = mapvote_count;
246 MapVote_AddVotable("don't care", false);
248 //dprint("mapvote count is ", ftos(mapvote_count), "\n");
250 mapvote_keeptwotime = time + autocvar_g_maplist_votable_keeptwotime;
251 mapvote_timeout = time + autocvar_g_maplist_votable_timeout;
252 if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
253 mapvote_keeptwotime = 0;
258 void MapVote_SendPicture(entity to, int id)
261 WriteHeader(MSG_ONE, TE_CSQC_PICTURE);
262 WriteByte(MSG_ONE, id);
263 WritePicture(MSG_ONE, strcat(mapvote_screenshot_dirs[mapvote_maps_screenshot_dir[id]], "/", mapvote_maps[id]), 3072);
267 void MapVote_WriteMask()
269 if ( mapvote_count < 24 )
272 for(int j = 0; j < mapvote_count; ++j)
274 if(mapvote_maps_flags[j] & GTV_AVAILABLE)
278 if(mapvote_count < 8)
279 WriteByte(MSG_ENTITY, mask);
280 else if (mapvote_count < 16)
281 WriteShort(MSG_ENTITY,mask);
283 WriteLong(MSG_ENTITY, mask);
287 for (int j = 0; j < mapvote_count; ++j)
288 WriteByte(MSG_ENTITY, mapvote_maps_flags[j]);
293 * Sends a single map vote option to the client
295 void MapVote_SendOption(int i)
298 if(mapvote_abstain && i == mapvote_count - 1)
300 WriteString(MSG_ENTITY, ""); // abstain needs no text
301 WriteString(MSG_ENTITY, ""); // abstain needs no pack
302 WriteByte(MSG_ENTITY, 0); // abstain needs no screenshot dir
306 WriteString(MSG_ENTITY, mapvote_maps[i]);
307 WriteString(MSG_ENTITY, mapvote_maps_pakfile[i]);
308 WriteByte(MSG_ENTITY, mapvote_maps_screenshot_dir[i]);
313 * Sends a single gametype vote option to the client
315 void GameTypeVote_SendOption(int i)
318 if(mapvote_abstain && i == mapvote_count - 1)
320 WriteString(MSG_ENTITY, ""); // abstain needs no text
321 WriteByte(MSG_ENTITY, GTV_AVAILABLE);
325 string type_name = mapvote_maps[i];
326 WriteString(MSG_ENTITY, type_name);
327 WriteByte(MSG_ENTITY, mapvote_maps_flags[i]);
328 if ( mapvote_maps_flags[i] & GTV_CUSTOM )
330 WriteString(MSG_ENTITY, cvar_string(
331 strcat("sv_vote_gametype_",type_name,"_name")));
332 WriteString(MSG_ENTITY, cvar_string(
333 strcat("sv_vote_gametype_",type_name,"_description")));
334 WriteString(MSG_ENTITY, cvar_string(
335 strcat("sv_vote_gametype_",type_name,"_type")));
341 float mapvote_winner_time;
342 bool MapVote_SendEntity(entity this, entity to, int sf)
347 sf &= ~2; // if we send 1, we don't need to also send 2
349 if (!mapvote_winner_time)
350 sf &= ~8; // no winner yet
352 WriteHeader(MSG_ENTITY, ENT_CLIENT_MAPVOTE);
353 WriteByte(MSG_ENTITY, sf);
357 // flag 1 == initialization
358 for(i = 0; i < mapvote_screenshot_dirs_count; ++i)
359 WriteString(MSG_ENTITY, mapvote_screenshot_dirs[i]);
360 WriteString(MSG_ENTITY, "");
361 WriteByte(MSG_ENTITY, mapvote_count);
362 WriteByte(MSG_ENTITY, mapvote_abstain);
363 WriteByte(MSG_ENTITY, mapvote_detail);
364 WriteCoord(MSG_ENTITY, mapvote_timeout);
369 WriteByte(MSG_ENTITY, 1);
370 WriteString(MSG_ENTITY, autocvar_nextmap);
372 else if ( autocvar_sv_vote_gametype )
374 // map vote but gametype has been chosen via voting screen
375 WriteByte(MSG_ENTITY, 2);
376 WriteString(MSG_ENTITY, MapInfo_Type_ToText(MapInfo_CurrentGametype()));
379 WriteByte(MSG_ENTITY, 0); // map vote
383 // Send data for the vote options
384 for(i = 0; i < mapvote_count; ++i)
387 GameTypeVote_SendOption(i);
389 MapVote_SendOption(i);
395 // flag 2 == update of mask
402 for(i = 0; i < mapvote_count; ++i)
403 if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
404 WriteByte(MSG_ENTITY, mapvote_selections[i]);
406 WriteByte(MSG_ENTITY, to.mapvote);
411 WriteByte(MSG_ENTITY, mapvote_winner + 1);
419 Net_LinkEntity(mapvote_ent = new(mapvote_ent), false, 0, MapVote_SendEntity);
422 void MapVote_TouchMask()
424 mapvote_ent.SendFlags |= 2;
427 void MapVote_TouchVotes(entity voter)
429 mapvote_ent.SendFlags |= 4;
432 void MapVote_Winner(int mappos)
434 mapvote_ent.SendFlags |= 8;
435 mapvote_winner_time = time;
436 mapvote_winner = mappos;
439 bool MapVote_Finished(int mappos)
441 if(alreadychangedlevel)
448 if(autocvar_sv_eventlog)
450 result = strcat(":vote:finished:", mapvote_maps[mappos]);
451 result = strcat(result, ":", ftos(mapvote_selections[mappos]), "::");
452 didntvote = mapvote_voters;
453 for(i = 0; i < mapvote_count; ++i)
454 if(mapvote_maps_flags[i] & GTV_AVAILABLE )
456 didntvote -= mapvote_selections[i];
459 result = strcat(result, ":", mapvote_maps[i]);
460 result = strcat(result, ":", ftos(mapvote_selections[i]));
463 result = strcat(result, ":didn't vote:", ftos(didntvote));
466 if(mapvote_maps_suggested[mappos])
467 GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]));
470 FOREACH_CLIENT(IS_REAL_CLIENT(it), { FixClientCvars(it); });
474 if ( GameTypeVote_Finished(mappos) )
476 gametypevote = false;
477 if(autocvar_nextmap != "")
479 Map_Goto_SetStr(autocvar_nextmap);
481 alreadychangedlevel = true;
490 MapVote_Winner(mappos);
491 alreadychangedlevel = true;
496 void MapVote_CheckRules_1()
498 for (int i = 0; i < mapvote_count; ++i)
499 if (mapvote_maps_flags[i] & GTV_AVAILABLE)
501 //dprint("Map ", ftos(i), ": "); dprint(mapvote_maps[i], "\n");
502 mapvote_selections[i] = 0;
506 FOREACH_CLIENT(IS_REAL_CLIENT(it), {
510 int idx = it.mapvote - 1;
511 //dprint("Player ", it.netname, " vote = ", ftos(idx), "\n");
512 ++mapvote_selections[idx];
517 bool MapVote_CheckRules_2()
520 int firstPlace, secondPlace, currentPlace;
521 int firstPlaceVotes, secondPlaceVotes, currentVotes;
522 int mapvote_voters_real;
525 if(mapvote_count_real == 1)
526 return MapVote_Finished(0);
528 mapvote_voters_real = mapvote_voters;
530 mapvote_voters_real -= mapvote_selections[mapvote_count - 1];
532 RandomSelection_Init();
535 for(i = 0; i < mapvote_count_real; ++i)
536 if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
538 RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
539 if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
541 currentVotes = mapvote_selections[i];
545 firstPlaceVotes = RandomSelection_best_priority;
546 if ( autocvar_sv_vote_gametype_default_current && firstPlaceVotes == 0 )
547 firstPlace = currentPlace;
549 firstPlace = RandomSelection_chosen_float;
551 //dprint("First place: ", ftos(firstPlace), "\n");
552 //dprint("First place votes: ", ftos(firstPlaceVotes), "\n");
554 RandomSelection_Init();
555 for(i = 0; i < mapvote_count_real; ++i)
557 if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
558 RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
559 secondPlace = RandomSelection_chosen_float;
560 secondPlaceVotes = RandomSelection_best_priority;
561 //dprint("Second place: ", ftos(secondPlace), "\n");
562 //dprint("Second place votes: ", ftos(secondPlaceVotes), "\n");
565 error("No first place in map vote... WTF?");
567 if(secondPlace == -1 || time > mapvote_timeout || (mapvote_voters_real - firstPlaceVotes) < firstPlaceVotes)
568 return MapVote_Finished(firstPlace);
570 if(mapvote_keeptwotime)
571 if(time > mapvote_keeptwotime || (mapvote_voters_real - firstPlaceVotes - secondPlaceVotes) < secondPlaceVotes)
574 mapvote_keeptwotime = 0;
575 result = strcat(":vote:keeptwo:", mapvote_maps[firstPlace]);
576 result = strcat(result, ":", ftos(firstPlaceVotes));
577 result = strcat(result, ":", mapvote_maps[secondPlace]);
578 result = strcat(result, ":", ftos(secondPlaceVotes), "::");
579 int didntvote = mapvote_voters;
580 for(i = 0; i < mapvote_count; ++i)
582 didntvote -= mapvote_selections[i];
586 result = strcat(result, ":", mapvote_maps[i]);
587 result = strcat(result, ":", ftos(mapvote_selections[i]));
588 if(i < mapvote_count_real)
590 mapvote_maps_flags[i] &= ~GTV_AVAILABLE;
594 result = strcat(result, ":didn't vote:", ftos(didntvote));
595 if(autocvar_sv_eventlog)
604 MapVote_CheckRules_1(); // count
605 if(MapVote_CheckRules_2()) // decide
609 FOREACH_CLIENT(true, {
610 if(!IS_REAL_CLIENT(it))
612 // apply the same special health value to bots too for consistency's sake
613 if(GetResource(it, RES_HEALTH) != 2342)
614 SetResourceExplicit(it, RES_HEALTH, 2342);
617 // hide scoreboard again
618 if(GetResource(it, RES_HEALTH) != 2342)
620 SetResourceExplicit(it, RES_HEALTH, 2342); // health in the voting phase
624 WriteByte(MSG_ONE, SVC_FINALE);
625 WriteString(MSG_ONE, "");
628 // clear possibly invalid votes
629 if ( !(mapvote_maps_flags[it.mapvote-1] & GTV_AVAILABLE) )
631 // use impulses as new vote
632 if(CS(it).impulse >= 1 && CS(it).impulse <= mapvote_count)
633 if( mapvote_maps_flags[CS(it).impulse - 1] & GTV_AVAILABLE )
635 it.mapvote = CS(it).impulse;
636 MapVote_TouchVotes(it);
644 MapVote_CheckRules_1(); // just count
649 // if mapvote is already running, don't do this initialization again
650 if(mapvote_run) { return; }
652 // don't start mapvote until after playerstats gamereport is sent
653 if(PlayerStats_GameReport_DelayMapVote) { return; }
656 if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
665 if (mapvote_winner_time)
667 if (time > mapvote_winner_time + 1)
669 Map_Goto_SetStr(mapvote_maps[mapvote_winner]);
675 if(alreadychangedlevel)
678 if(time < mapvote_nextthink)
682 mapvote_nextthink = time + 0.5;
683 if (mapvote_nextthink > mapvote_timeout - 0.1) // make sure there's no delay when map vote times out
684 mapvote_nextthink = mapvote_timeout + 0.001;
686 if(!mapvote_initialized)
688 if(autocvar_rescan_pending == 1)
690 cvar_set("rescan_pending", "2");
691 localcmd("fs_rescan\nrescan_pending 3\n");
694 else if(autocvar_rescan_pending == 2)
698 else if(autocvar_rescan_pending == 3)
700 // now build missing mapinfo files
701 if(!MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
704 // we're done, start the timer
705 cvar_set("rescan_pending", "0");
708 mapvote_initialized = true;
709 if(DoNextMapOverride(0))
711 if(!autocvar_g_maplist_votable || player_count <= 0)
717 if(autocvar_sv_vote_gametype) { GameTypeVote_Start(); }
718 else if(autocvar_nextmap == "") { MapVote_Init(); }
724 bool GameTypeVote_SetGametype(Gametype type)
726 if (MapInfo_CurrentGametype() == type)
729 Gametype tsave = MapInfo_CurrentGametype();
731 MapInfo_SwitchGameType(type);
734 MapInfo_FilterGametype(type, MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
735 if(MapInfo_count > 0)
737 // update lsmaps in case the gametype changed, this way people can easily list maps for it
738 if(lsmaps_reply != "") { strunzone(lsmaps_reply); }
739 lsmaps_reply = strzone(getlsmaps());
740 bprint("Game type successfully switched to ", MapInfo_Type_ToString(type), "\n");
744 bprint("Cannot use this game type: no map for it found\n");
745 MapInfo_SwitchGameType(tsave);
746 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
750 //localcmd("gametype ", MapInfo_Type_ToString(type), "\n");
752 cvar_set("g_maplist", MapInfo_ListAllowedMaps(type, MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()) );
753 if(autocvar_g_maplist_shuffle)
759 bool gametypevote_finished;
760 bool GameTypeVote_Finished(int pos)
762 if(!gametypevote || gametypevote_finished)
765 localcmd("sv_vote_gametype_hook_all\n");
766 localcmd("sv_vote_gametype_hook_", mapvote_maps[pos], "\n");
768 if ( !GameTypeVote_SetGametype(GameTypeVote_Type_FromString(mapvote_maps[pos])) )
770 LOG_TRACE("Selected gametype is not supported by any map");
773 gametypevote_finished = true;
778 bool GameTypeVote_AddVotable(string nextMode)
780 if ( nextMode == "" || GameTypeVote_Type_FromString(nextMode) == NULL )
783 for(int j = 0; j < mapvote_count; ++j)
784 if(mapvote_maps[j] == nextMode)
787 mapvote_maps[mapvote_count] = strzone(nextMode);
788 mapvote_maps_suggested[mapvote_count] = false;
790 mapvote_maps_screenshot_dir[mapvote_count] = 0;
791 mapvote_maps_pakfile[mapvote_count] = strzone("");
792 mapvote_maps_flags[mapvote_count] = GameTypeVote_AvailabilityStatus(nextMode);
800 bool GameTypeVote_Start()
802 MapVote_ClearAllVotes();
803 MapVote_UnzoneStrings();
806 mapvote_timeout = time + autocvar_sv_vote_gametype_timeout;
807 mapvote_abstain = false;
808 mapvote_detail = !autocvar_g_maplist_votable_nodetail;
810 int n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " ");
811 n = min(MAPVOTE_COUNT, n);
813 int really_available, which_available;
814 really_available = 0;
815 which_available = -1;
816 for(int j = 0; j < n; ++j)
818 if ( GameTypeVote_AddVotable(argv(j)) )
819 if ( mapvote_maps_flags[j] & GTV_AVAILABLE )
826 mapvote_count_real = mapvote_count;
830 if ( really_available == 0 )
832 if ( mapvote_count > 0 )
833 strunzone(mapvote_maps[0]);
834 mapvote_maps[0] = strzone(MapInfo_Type_ToString(MapInfo_CurrentGametype()));
835 //GameTypeVote_Finished(0);
839 if ( really_available == 1 )
841 //GameTypeVote_Finished(which_available);
842 MapVote_Finished(which_available);
846 mapvote_count_real = mapvote_count;
848 mapvote_keeptwotime = time + autocvar_sv_vote_gametype_keeptwotime;
849 if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
850 mapvote_keeptwotime = 0;