// properly restarts the map applying the current game type.
// Applying voted_gametype before map vote start is needed to properly initialize map vote.
if (match_gametype)
- GameTypeVote_ApplyGameType(match_gametype, gametype_custom_string);
+ GameTypeVote_ApplyGameType(match_gametype, loaded_gametype_custom_string);
}
void MapVote_SendPicture(entity to, int id)
RandomSelection_Init();
currentPlace = 0;
currentVotes = -1;
+ string current_gametype_string;
+ if (loaded_gametype_custom_string != "")
+ current_gametype_string = loaded_gametype_custom_string;
+ else
+ current_gametype_string = MapInfo_Type_ToString(MapInfo_CurrentGametype());
for(i = 0; i < mapvote_count_real; ++i)
if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
{
RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
- if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
+ if ( gametypevote && mapvote_maps[i] == current_gametype_string )
{
currentVotes = mapvote_selections[i];
currentPlace = i;
{
if ( mapvote_count > 0 )
strunzone(mapvote_maps[0]);
- mapvote_maps[0] = strzone(MapInfo_Type_ToString(MapInfo_CurrentGametype()));
+ string current_gametype_string;
+ if (loaded_gametype_custom_string != "")
+ current_gametype_string = loaded_gametype_custom_string;
+ else
+ current_gametype_string = MapInfo_Type_ToString(MapInfo_CurrentGametype());
+ mapvote_maps[0] = strzone(current_gametype_string);
//GameTypeVote_Finished(0);
MapVote_Finished(0);
return false;
WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
WriteRegistered(Gametypes, MSG_ENTITY, MapInfo_LoadedGametype);
string gt_name = "";
- if (gametype_custom_string != "")
- gt_name = cvar_string(strcat("sv_vote_gametype_", gametype_custom_string, "_name"));
+ if (loaded_gametype_custom_string != "")
+ gt_name = cvar_string(strcat("sv_vote_gametype_", loaded_gametype_custom_string, "_name"));
WriteString(MSG_ENTITY, gt_name);
FOREACH(Scores, true, {
WriteString(MSG_ENTITY, scores_label(it));
MapInfo_ClearTemps();
- strcpy(gametype_custom_string, autocvar__sv_vote_gametype_custom);
+ strcpy(loaded_gametype_custom_string, autocvar__sv_vote_gametype_custom);
cvar_set("_sv_vote_gametype_custom", ""); // clear it immediately so it can't get stuck
cache_mutatormsg = strzone("");
MapInfo_Shutdown();
strfree(sv_termsofservice_url_escaped);
- strfree(gametype_custom_string);
+ strfree(loaded_gametype_custom_string);
}
else if(world_initialized == 0)
{