updated mapchooser to avoid bug caused by calling rockthevote native or by calling SetupTimeleftTimer without g_WaitingForVote check

This commit is contained in:
jenz 2023-09-17 15:53:15 +02:00
parent 59eb86fa23
commit 0b14a79482

View File

@ -138,7 +138,6 @@ bool g_ChangeMapInProgress;
bool g_HasIntermissionStarted = false; bool g_HasIntermissionStarted = false;
int g_mapFileSerial = -1; int g_mapFileSerial = -1;
bool prevent_rare_map_vote_bug_2023 = false; //this is not very cool -jenz
int g_NominateCount = 0; int g_NominateCount = 0;
int g_NominateReservedCount = 0; int g_NominateReservedCount = 0;
@ -400,7 +399,6 @@ public void OnPluginStart()
g_MapVoteWarningTickForward = CreateGlobalForward("OnMapVoteWarningTick", ET_Ignore, Param_Cell); g_MapVoteWarningTickForward = CreateGlobalForward("OnMapVoteWarningTick", ET_Ignore, Param_Cell);
g_MapVoteRunoffStartForward = CreateGlobalForward("OnMapVoteRunnoffWarningStart", ET_Ignore); g_MapVoteRunoffStartForward = CreateGlobalForward("OnMapVoteRunnoffWarningStart", ET_Ignore);
prevent_rare_map_vote_bug_2023 = false;
InternalRestoreMapCooldowns(); InternalRestoreMapCooldowns();
} }
@ -557,7 +555,6 @@ public void OnMapEnd()
g_WarningTimer = INVALID_HANDLE; g_WarningTimer = INVALID_HANDLE;
g_RunoffCount = 0; g_RunoffCount = 0;
prevent_rare_map_vote_bug_2023 = false;
static char map[PLATFORM_MAX_PATH]; static char map[PLATFORM_MAX_PATH];
int Cooldown; int Cooldown;
@ -688,55 +685,63 @@ public Action Command_ExtendsLeft(int client, int args)
public void OnMapTimeLeftChanged() public void OnMapTimeLeftChanged()
{ {
if(GetArraySize(g_MapList)) if(GetArraySize(g_MapList))
SetupTimeleftTimer(); {
//LogMessage("Mapchooser_extended_avg OnMapTimeLeftChanged call.");
SetupTimeleftTimer();
}
} }
void SetupTimeleftTimer() void SetupTimeleftTimer()
{ {
int time; int time;
if(GetMapTimeLeft(time) && time > 0) if(GetMapTimeLeft(time) && time > 0)
{ {
int startTime; int startTime;
if(GetConVarBool(g_Cvar_StartTimePercentEnable)) if(GetConVarBool(g_Cvar_StartTimePercentEnable))
{ {
int timeLimit; int timeLimit;
if(GetMapTimeLimit(timeLimit) && timeLimit > 0) if(GetMapTimeLimit(timeLimit) && timeLimit > 0)
{ {
startTime = GetConVarInt(g_Cvar_StartTimePercent) * (timeLimit * 60) / 100; startTime = GetConVarInt(g_Cvar_StartTimePercent) * (timeLimit * 60) / 100;
} }
} }
else else
startTime = GetConVarInt(g_Cvar_StartTime) * 60; startTime = GetConVarInt(g_Cvar_StartTime) * 60;
if(time - startTime < 0 && GetConVarBool(g_Cvar_EndOfMapVote) && !g_MapVoteCompleted && !g_HasVoteStarted) if(time - startTime < 0 && GetConVarBool(g_Cvar_EndOfMapVote) && !g_MapVoteCompleted && !g_HasVoteStarted && !g_WaitingForVote)
{ {
SetupWarningTimer(WarningType_Vote); SetupWarningTimer(WarningType_Vote);
} //LogMessage("Mapchooser_extended_avg SetupWarningTimer call 2");
else }
{ else
if(g_WarningTimer == INVALID_HANDLE) {
{ if(g_WarningTimer == INVALID_HANDLE)
if(g_VoteTimer != INVALID_HANDLE) {
{ if(g_VoteTimer != INVALID_HANDLE)
KillTimer(g_VoteTimer); {
g_VoteTimer = INVALID_HANDLE; KillTimer(g_VoteTimer);
} g_VoteTimer = INVALID_HANDLE;
}
//g_VoteTimer = CreateTimer(float(time - startTime), Timer_StartMapVoteTimer_StartMapVote, _, TIMER_FLAG_NO_MAPCHANGE); //g_VoteTimer = CreateTimer(float(time - startTime), Timer_StartMapVoteTimer_StartMapVote, _, TIMER_FLAG_NO_MAPCHANGE);
g_VoteTimer = CreateTimer(float(time - startTime), Timer_StartWarningTimer, _, TIMER_FLAG_NO_MAPCHANGE); //LogMessage("Mapchooser_extended_avg g_VoteTimer Timer_StartWarningTimer");
} g_VoteTimer = CreateTimer(float(time - startTime), Timer_StartWarningTimer, _, TIMER_FLAG_NO_MAPCHANGE);
} }
} }
}
} }
public Action Timer_StartWarningTimer(Handle timer) public Action Timer_StartWarningTimer(Handle timer)
{ {
g_VoteTimer = INVALID_HANDLE; g_VoteTimer = INVALID_HANDLE;
if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE) if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE)
SetupWarningTimer(WarningType_Vote); {
return Plugin_Stop; //LogMessage("Mapchooser_extended_avg SetupWarningTimer call 3");
SetupWarningTimer(WarningType_Vote);
}
return Plugin_Stop;
} }
public Action Timer_StartMapVote(Handle timer, Handle data) public Action Timer_StartMapVote(Handle timer, Handle data)
@ -747,6 +752,7 @@ public Action Timer_StartMapVote(Handle timer, Handle data)
if(!GetArraySize(g_MapList) || !GetConVarBool(g_Cvar_EndOfMapVote) || g_MapVoteCompleted || g_HasVoteStarted) if(!GetArraySize(g_MapList) || !GetConVarBool(g_Cvar_EndOfMapVote) || g_MapVoteCompleted || g_HasVoteStarted)
{ {
g_WarningTimer = INVALID_HANDLE; g_WarningTimer = INVALID_HANDLE;
//LogMessage("Mapchooser_extended_avg Timer_Start MapVote Plugin_Stop");
return Plugin_Stop; return Plugin_Stop;
} }
@ -785,6 +791,7 @@ public Action Timer_StartMapVote(Handle timer, Handle data)
} }
} }
//LogMessage("timePassed: %i \n warningMaxTime: %i", timePassed, warningMaxTime);
if(timePassed++ >= warningMaxTime) if(timePassed++ >= warningMaxTime)
{ {
if(timer == g_RetryTimer) if(timer == g_RetryTimer)
@ -798,12 +805,8 @@ public Action Timer_StartMapVote(Handle timer, Handle data)
timePassed = 0; timePassed = 0;
MapChange mapChange = view_as<MapChange>(ReadPackCell(data)); MapChange mapChange = view_as<MapChange>(ReadPackCell(data));
Handle hndl = view_as<Handle>(ReadPackCell(data)); Handle hndl = view_as<Handle>(ReadPackCell(data));
//LogMessage("Mapchooser_extended_avg calling InitiateVote()");
if (!prevent_rare_map_vote_bug_2023) InitiateVote(mapChange, hndl);
{
InitiateVote(mapChange, hndl);
}
return Plugin_Stop; return Plugin_Stop;
} }
@ -908,40 +911,42 @@ public void Event_RoundEnd(Handle event, const char[] name, bool dontBroadcast)
public void CheckWinLimit(int winner_score) public void CheckWinLimit(int winner_score)
{ {
int winlimit = GetConVarInt(g_Cvar_Winlimit); int winlimit = GetConVarInt(g_Cvar_Winlimit);
if(winlimit) if(winlimit)
{ {
if(winner_score >= (winlimit - GetConVarInt(g_Cvar_StartRounds))) if(winner_score >= (winlimit - GetConVarInt(g_Cvar_StartRounds)))
{ {
if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE) if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE)
{ {
SetupWarningTimer(WarningType_Vote, MapChange_MapEnd); SetupWarningTimer(WarningType_Vote, MapChange_MapEnd);
} //LogMessage("Mapchooser_extended_avg SetupWarningTimer call 4");
} }
} }
}
} }
public void CheckMaxRounds(int roundcount) public void CheckMaxRounds(int roundcount)
{ {
int maxrounds = 0; int maxrounds = 0;
if(g_RoundCounting == RoundCounting_ArmsRace) if(g_RoundCounting == RoundCounting_ArmsRace)
maxrounds = GameRules_GetProp("m_iNumGunGameProgressiveWeaponsCT"); maxrounds = GameRules_GetProp("m_iNumGunGameProgressiveWeaponsCT");
else if(g_RoundCounting == RoundCounting_MvM) else if(g_RoundCounting == RoundCounting_MvM)
maxrounds = GetEntProp(g_ObjectiveEnt, Prop_Send, "m_nMannVsMachineMaxWaveCount"); maxrounds = GetEntProp(g_ObjectiveEnt, Prop_Send, "m_nMannVsMachineMaxWaveCount");
else else
return; return;
if(maxrounds) if(maxrounds)
{ {
if(roundcount >= (maxrounds - GetConVarInt(g_Cvar_StartRounds))) if(roundcount >= (maxrounds - GetConVarInt(g_Cvar_StartRounds)))
{ {
if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE) if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE)
{ {
SetupWarningTimer(WarningType_Vote, MapChange_MapEnd); SetupWarningTimer(WarningType_Vote, MapChange_MapEnd);
} //LogMessage("Mapchooser_extended_avg SetupWarningTimer call 5");
} }
} }
}
} }
public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadcast) public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
@ -965,6 +970,7 @@ public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadc
if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE) if(!g_WarningInProgress || g_WarningTimer == INVALID_HANDLE)
{ {
SetupWarningTimer(WarningType_Vote, MapChange_MapEnd); SetupWarningTimer(WarningType_Vote, MapChange_MapEnd);
//LogMessage("Mapchooser_extended_avg SetupWarningTimer call 6");
} }
} }
return Plugin_Continue; return Plugin_Continue;
@ -972,11 +978,12 @@ public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadc
public Action Command_Mapvote(int client, int args) public Action Command_Mapvote(int client, int args)
{ {
ShowActivity2(client, "[MCE] ", "%t", "Initiated Vote Map"); ShowActivity2(client, "[MCE] ", "%t", "Initiated Vote Map");
SetupWarningTimer(WarningType_Vote, MapChange_MapEnd, INVALID_HANDLE, true); SetupWarningTimer(WarningType_Vote, MapChange_MapEnd, INVALID_HANDLE, true);
//LogMessage("Mapchooser_extended_avg SetupWarningTimer call 7");
return Plugin_Handled; return Plugin_Handled;
} }
public Handle get_most_nominated_maps() public Handle get_most_nominated_maps()
@ -1103,6 +1110,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
CPrintToChatAll("[MCE] %t", "Cannot Start Vote", FAILURE_TIMER_LENGTH); CPrintToChatAll("[MCE] %t", "Cannot Start Vote", FAILURE_TIMER_LENGTH);
Handle data; Handle data;
g_RetryTimer = CreateDataTimer(1.0, Timer_StartMapVote, data, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT); g_RetryTimer = CreateDataTimer(1.0, Timer_StartMapVote, data, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
//LogMessage("Mapchooser_extended_avg: called Timer_StartMapVote");
/* Mapchooser Extended */ /* Mapchooser Extended */
WritePackCell(data, FAILURE_TIMER_LENGTH); WritePackCell(data, FAILURE_TIMER_LENGTH);
@ -1121,16 +1129,17 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
/* If the main map vote has completed (and chosen result) and its currently changing (not a delayed change) we block further attempts */ /* If the main map vote has completed (and chosen result) and its currently changing (not a delayed change) we block further attempts */
if(g_MapVoteCompleted && g_ChangeMapInProgress) if(g_MapVoteCompleted && g_ChangeMapInProgress)
{
//LogMessage("Mapchooser_extended_avg ended here: g_MapVoteCompleted: %i \n g_ChangeMapInProgress: %i", g_MapVoteCompleted, g_ChangeMapInProgress);
return; return;
}
prevent_rare_map_vote_bug_2023 = true;
CheckMapRestrictions(true, true); CheckMapRestrictions(true, true);
CreateNextVote(); CreateNextVote();
g_ChangeTime = when; g_ChangeTime = when;
g_WaitingForVote = false;
g_HasVoteStarted = true; g_HasVoteStarted = true;
@ -1446,14 +1455,15 @@ public void Handler_MapVoteFinished(Handle menu,
const int[][] item_info) const int[][] item_info)
{ {
// Implement revote logic - Only run this` block if revotes are enabled and this isn't the last revote' // Implement revote logic - Only run this` block if revotes are enabled and this isn't the last revote'
prevent_rare_map_vote_bug_2023 = false; //LogMessage("Mapchooser_extended_avg Handler_MapVoteFinished.");
//LogMessage("Mapchooser_extended_avg g_Cvar_RunOff: %i num_items: %i g_RunoffCount %i g_Cvar_MaxRunOffs %i", GetConVarBool(g_Cvar_RunOff), num_items, g_RunoffCount, GetConVarInt(g_Cvar_MaxRunOffs));
if(GetConVarBool(g_Cvar_RunOff) && num_items > 1 && g_RunoffCount < GetConVarInt(g_Cvar_MaxRunOffs)) if(GetConVarBool(g_Cvar_RunOff) && num_items > 1 && g_RunoffCount < GetConVarInt(g_Cvar_MaxRunOffs))
{ {
//LogMessage("Mapchooser_extended_avg Handler_MapVoteFinished passed check1.");
g_RunoffCount++; g_RunoffCount++;
int highest_votes = item_info[0][VOTEINFO_ITEM_VOTES]; int highest_votes = item_info[0][VOTEINFO_ITEM_VOTES];
int required_percent = GetConVarInt(g_Cvar_RunOffPercent); int required_percent = GetConVarInt(g_Cvar_RunOffPercent);
int required_votes = RoundToCeil(float(num_votes) * float(required_percent) / 100.0); int required_votes = RoundToCeil(float(num_votes) * float(required_percent) / 100.0);
if(highest_votes == item_info[1][VOTEINFO_ITEM_VOTES]) if(highest_votes == item_info[1][VOTEINFO_ITEM_VOTES])
{ {
g_HasVoteStarted = false; g_HasVoteStarted = false;
@ -1476,6 +1486,7 @@ public void Handler_MapVoteFinished(Handle menu,
} }
CPrintToChatAll("[MCE] %t", "Tie Vote", GetArraySize(mapList)); CPrintToChatAll("[MCE] %t", "Tie Vote", GetArraySize(mapList));
//LogMessage("Mapchooser_extended_avg reached WarningType_Revote 1");
SetupWarningTimer(WarningType_Revote, view_as<MapChange>(g_ChangeTime), mapList); SetupWarningTimer(WarningType_Revote, view_as<MapChange>(g_ChangeTime), mapList);
return; return;
} }
@ -1506,122 +1517,125 @@ public void Handler_MapVoteFinished(Handle menu,
} }
CPrintToChatAll("[MCE] %t", "Revote Is Needed", required_percent); CPrintToChatAll("[MCE] %t", "Revote Is Needed", required_percent);
//LogMessage("Mapchooser_extended_avg reached WarningType_Revote 2");
SetupWarningTimer(WarningType_Revote, view_as<MapChange>(g_ChangeTime), mapList); SetupWarningTimer(WarningType_Revote, view_as<MapChange>(g_ChangeTime), mapList);
return; return;
} }
} }
g_WaitingForVote = false;
//LogMessage("Mapchooser_extended_avg no revote needed, continue as normal.");
// No revote needed, continue as normal. // No revote needed, continue as normal.
Handler_VoteFinishedGeneric(menu, num_votes, num_clients, client_info, num_items, item_info); Handler_VoteFinishedGeneric(menu, num_votes, num_clients, client_info, num_items, item_info);
} }
public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int param2) public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int param2)
{ {
switch(action) switch(action)
{ {
case MenuAction_End: case MenuAction_End:
{ {
g_VoteMenu = INVALID_HANDLE; g_VoteMenu = INVALID_HANDLE;
delete menu; delete menu;
} }
case MenuAction_Display: case MenuAction_Display:
{ {
static char buffer[255]; static char buffer[255];
Format(buffer, sizeof(buffer), "%T", "Vote Nextmap", param1); Format(buffer, sizeof(buffer), "%T", "Vote Nextmap", param1);
Handle panel = view_as<Handle>(param2); Handle panel = view_as<Handle>(param2);
SetPanelTitle(panel, buffer); SetPanelTitle(panel, buffer);
DrawPanelText(panel, "Warning: The Position of the Maps are different for each Player."); DrawPanelText(panel, "Warning: The Position of the Maps are different for each Player.");
} }
case MenuAction_DisplayItem: case MenuAction_DisplayItem:
{ {
char map[PLATFORM_MAX_PATH]; char map[PLATFORM_MAX_PATH];
char buffer[255]; char buffer[255];
int mark = GetConVarInt(g_Cvar_MarkCustomMaps); int mark = GetConVarInt(g_Cvar_MarkCustomMaps);
GetMenuItem(menu, param2, map, PLATFORM_MAX_PATH, _, _, _, param1); GetMenuItem(menu, param2, map, PLATFORM_MAX_PATH, _, _, _, param1);
if(StrEqual(map, VOTE_EXTEND, false)) if(StrEqual(map, VOTE_EXTEND, false))
{ {
Format(buffer, sizeof(buffer), "%T", "Extend Map", param1); Format(buffer, sizeof(buffer), "%T", "Extend Map", param1);
} }
else if(StrEqual(map, VOTE_DONTCHANGE, false)) else if(StrEqual(map, VOTE_DONTCHANGE, false))
{ {
Format(buffer, sizeof(buffer), "%T", "Dont Change", param1); Format(buffer, sizeof(buffer), "%T", "Dont Change", param1);
} }
// Mapchooser Extended // Mapchooser Extended
else if(StrEqual(map, LINE_ONE, false)) else if(StrEqual(map, LINE_ONE, false))
{ {
Format(buffer, sizeof(buffer),"%T", "Line One", param1); Format(buffer, sizeof(buffer),"%T", "Line One", param1);
} }
else if(StrEqual(map, LINE_TWO, false)) else if(StrEqual(map, LINE_TWO, false))
{ {
Format(buffer, sizeof(buffer),"%T", "Line Two", param1); Format(buffer, sizeof(buffer),"%T", "Line Two", param1);
} }
// Note that the first part is to discard the spacer line // Note that the first part is to discard the spacer line
else if(!StrEqual(map, LINE_SPACER, false)) else if(!StrEqual(map, LINE_SPACER, false))
{ {
if(mark == 1 && !InternalIsMapOfficial(map)) if(mark == 1 && !InternalIsMapOfficial(map))
{ {
Format(buffer, sizeof(buffer), "%T", "Custom Marked", param1, map); Format(buffer, sizeof(buffer), "%T", "Custom Marked", param1, map);
} }
else if(mark == 2 && !InternalIsMapOfficial(map)) else if(mark == 2 && !InternalIsMapOfficial(map))
{ {
Format(buffer, sizeof(buffer), "%T", "Custom", param1, map); Format(buffer, sizeof(buffer), "%T", "Custom", param1, map);
} }
else if(InternalGetMapVIPRestriction(map)) else if(InternalGetMapVIPRestriction(map))
{ {
Format(buffer, sizeof(buffer), "%s (%T)", map, "VIP Nomination", param1); Format(buffer, sizeof(buffer), "%s (%T)", map, "VIP Nomination", param1);
} }
} }
if(buffer[0] != '\0') if(buffer[0] != '\0')
{ {
return RedrawMenuItem(buffer); return RedrawMenuItem(buffer);
} }
// End Mapchooser Extended // End Mapchooser Extended
} }
case MenuAction_VoteCancel: case MenuAction_VoteCancel:
{ {
// If we receive 0 votes, pick at random. // If we receive 0 votes, pick at random.
if(param1 == VoteCancel_NoVotes && GetConVarBool(g_Cvar_NoVoteMode)) if(param1 == VoteCancel_NoVotes && GetConVarBool(g_Cvar_NoVoteMode))
{ {
int count = GetMenuItemCount(menu); int count = GetMenuItemCount(menu);
int item; int item;
static char map[PLATFORM_MAX_PATH]; static char map[PLATFORM_MAX_PATH];
do do
{ {
int startInt = 0; int startInt = 0;
if(g_BlockedSlots) if(g_BlockedSlots)
{ {
if(g_AddNoVote) if(g_AddNoVote)
{ {
startInt = 2; startInt = 2;
} }
else else
{ {
startInt = 3; startInt = 3;
} }
} }
item = GetRandomInt(startInt, count - 1); item = GetRandomInt(startInt, count - 1);
GetMenuItem(menu, item, map, PLATFORM_MAX_PATH, _, _, _, param1); GetMenuItem(menu, item, map, PLATFORM_MAX_PATH, _, _, _, param1);
} }
while(strcmp(map, VOTE_EXTEND, false) == 0); while(strcmp(map, VOTE_EXTEND, false) == 0);
SetNextMap(map); SetNextMap(map);
g_MapVoteCompleted = true; g_MapVoteCompleted = true;
} }
g_WaitingForVote = false;
g_HasVoteStarted = false; g_HasVoteStarted = false;
} g_RunoffCount = 0;
} }
}
return 0; return 0;
} }
public Action Timer_ChangeMap(Handle hTimer, Handle dp) public Action Timer_ChangeMap(Handle hTimer, Handle dp)
@ -1977,6 +1991,7 @@ public int Native_InitiateVote(Handle plugin, int numParams)
LogAction(-1, -1, "Starting map vote because outside request"); LogAction(-1, -1, "Starting map vote because outside request");
SetupWarningTimer(WarningType_Vote, when, inputarray); SetupWarningTimer(WarningType_Vote, when, inputarray);
//LogMessage("Mapchooser_extended_avg SetupWarningTimer call 1");
return 0; return 0;
} }
@ -2048,54 +2063,54 @@ public int Native_GetNominatedMapList(Handle plugin, int numParams)
// Functions new to Mapchooser Extended // Functions new to Mapchooser Extended
stock void SetupWarningTimer(WarningType type, MapChange when=MapChange_MapEnd, Handle mapList=INVALID_HANDLE, bool force=false) stock void SetupWarningTimer(WarningType type, MapChange when=MapChange_MapEnd, Handle mapList=INVALID_HANDLE, bool force=false)
{ {
if(!GetArraySize(g_MapList) || g_ChangeMapInProgress || g_HasVoteStarted || (!force && ((when == MapChange_MapEnd && !GetConVarBool(g_Cvar_EndOfMapVote)) || g_MapVoteCompleted))) if(!GetArraySize(g_MapList) || g_ChangeMapInProgress || g_HasVoteStarted || (!force && ((when == MapChange_MapEnd && !GetConVarBool(g_Cvar_EndOfMapVote)) || g_MapVoteCompleted)))
return; return;
bool interrupted = false; bool interrupted = false;
if(g_WarningInProgress && g_WarningTimer != INVALID_HANDLE) if(g_WarningInProgress && g_WarningTimer != INVALID_HANDLE)
{ {
interrupted = true; interrupted = true;
KillTimer(g_WarningTimer); KillTimer(g_WarningTimer);
} }
g_WarningInProgress = true; g_WarningInProgress = true;
Handle forwardVote; Handle forwardVote;
Handle cvarTime; Handle cvarTime;
static char translationKey[64]; static char translationKey[64];
switch(type) switch(type)
{ {
case WarningType_Vote: case WarningType_Vote:
{ {
forwardVote = g_MapVoteWarningStartForward; forwardVote = g_MapVoteWarningStartForward;
cvarTime = g_Cvar_WarningTime; cvarTime = g_Cvar_WarningTime;
strcopy(translationKey, sizeof(translationKey), "Vote Warning"); strcopy(translationKey, sizeof(translationKey), "Vote Warning");
//LogMessage("Mapchooser_extended_avg WarningType_Vote");
}
} case WarningType_Revote:
{
forwardVote = g_MapVoteRunoffStartForward;
cvarTime = g_Cvar_RunOffWarningTime;
strcopy(translationKey, sizeof(translationKey), "Revote Warning");
//LogMessage("Mapchooser_extended_avg WarningType_Revote. cvarTime: %i", GetConVarInt(cvarTime));
}
}
case WarningType_Revote: if(!interrupted)
{ {
forwardVote = g_MapVoteRunoffStartForward; Call_StartForward(forwardVote);
cvarTime = g_Cvar_RunOffWarningTime; Call_Finish();
strcopy(translationKey, sizeof(translationKey), "Revote Warning"); }
} Handle data;
} g_WarningTimer = CreateDataTimer(1.0, Timer_StartMapVote, data, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
WritePackCell(data, GetConVarInt(cvarTime));
if(!interrupted) WritePackString(data, translationKey);
{ WritePackCell(data, view_as<int>(when));
Call_StartForward(forwardVote); WritePackCell(data, view_as<int>(mapList));
Call_Finish(); ResetPack(data);
}
Handle data;
g_WarningTimer = CreateDataTimer(1.0, Timer_StartMapVote, data, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
WritePackCell(data, GetConVarInt(cvarTime));
WritePackString(data, translationKey);
WritePackCell(data, view_as<int>(when));
WritePackCell(data, view_as<int>(mapList));
ResetPack(data);
} }
stock void InitializeOfficialMapList() stock void InitializeOfficialMapList()