Fixed amb1957 - Mapchooser now counts arena rounds correctly.

Fixed amb1925 - Mapchooser countly rounds incorrectly during an RTV
Fixed amb1920 - Cleared retry timer
Fixed amb1921 - Cancelling a vote now marks the vote as complete

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402475
This commit is contained in:
Matt Woodrow 2008-08-27 00:49:56 +00:00
parent 93944e7f4b
commit 094acb1039

View File

@ -138,6 +138,7 @@ public OnPluginStart()
HookEvent("round_end", Event_RoundEnd);
HookEventEx("teamplay_win_panel", Event_TeamPlayWinPanel);
HookEventEx("teamplay_restart_round", Event_TFRestartRound);
HookEventEx("arena_win_panel", Event_TeamPlayWinPanel);
}
if (g_Cvar_Fraglimit != INVALID_HANDLE)
@ -316,6 +317,7 @@ public Action:Timer_StartMapVote(Handle:timer)
{
if (timer == g_RetryTimer)
{
g_WaitingForVote = false;
g_RetryTimer = INVALID_HANDLE;
}
else
@ -347,16 +349,23 @@ public Event_TeamPlayWinPanel(Handle:event, const String:name[], bool:dontBroadc
CreateTimer(2.0, Timer_ChangeMap, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
}
if (!GetArraySize(g_MapList) || g_HasVoteStarted || g_MapVoteCompleted || !GetConVarBool(g_Cvar_EndOfMapVote))
{
return;
}
new bluescore = GetEventInt(event, "blue_score");
new redscore = GetEventInt(event, "red_score");
if(GetEventInt(event, "round_complete") == 1)
{
LogMessage("Win Panel Detected - Red Score %i, Blue Score %i", redscore, bluescore);
if(GetEventInt(event, "round_complete") == 1 || StrEqual(name, "arena_win_panel"))
{
g_TotalRounds++;
CheckMaxRounds(g_TotalRounds);
LogMessage("Round Completed! rounds %i", g_TotalRounds);
if (!GetArraySize(g_MapList) || g_HasVoteStarted || g_MapVoteCompleted || !GetConVarBool(g_Cvar_EndOfMapVote))
{
return;
}
switch(GetEventInt(event, "winning_team"))
{
case 3:
@ -373,9 +382,6 @@ public Event_TeamPlayWinPanel(Handle:event, const String:name[], bool:dontBroadc
return;
}
}
g_TotalRounds++;
CheckMaxRounds(g_TotalRounds);
}
}
/* You ask, why don't you just use team_score event? And I answer... Because CSS doesn't. */
@ -387,11 +393,6 @@ public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
CreateTimer(2.0, Timer_ChangeMap, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
}
if (!GetArraySize(g_MapList) || g_HasVoteStarted || g_MapVoteCompleted)
{
return;
}
new winner = GetEventInt(event, "winner");
if (winner == 0 || winner == 1 || !GetConVarBool(g_Cvar_EndOfMapVote))
@ -408,6 +409,11 @@ public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
g_winCount[winner]++;
if (!GetArraySize(g_MapList) || g_HasVoteStarted || g_MapVoteCompleted)
{
return;
}
CheckWinLimit(g_winCount[winner]);
CheckMaxRounds(g_TotalRounds);
}
@ -760,6 +766,9 @@ public Handler_MapVoteMenu(Handle:menu, MenuAction:action, param1, param2)
{
// We were actually cancelled. I guess we do nothing.
}
g_HasVoteStarted = false;
g_MapVoteCompleted = true;
}
}