Fix Achievement Defense of the Ancients

The spell that trigger the achievement check, needs to be cast before setting up the variables used for the second round, otherwise the achievement will be granted to the wrong team.
Also, SPELL_END_OF_ROUND needs to be casted on the end of the second round too, this was confirmed in retail.

(cherry picked from commit 5cf794b379)
This commit is contained in:
sirikfoll
2016-01-27 14:57:05 -02:00
committed by Shauren
parent ca1239af9f
commit 7031090dc3

View File

@@ -389,6 +389,8 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
{
if (TotalTime >= BG_SA_ROUNDLENGTH)
{
CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE);
CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE);
RoundScores[0].winner = Attackers;
RoundScores[0].time = BG_SA_ROUNDLENGTH;
TotalTime = 0;
@@ -401,8 +403,6 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
ToggleTimer();
ResetObjs();
GetBgMap()->UpdateAreaDependentAuras();
CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE);
CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE);
return;
}
}
@@ -410,6 +410,8 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
{
if (TotalTime >= EndRoundTimer)
{
CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE);
CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE);
RoundScores[1].time = BG_SA_ROUNDLENGTH;
RoundScores[1].winner = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
if (RoundScores[0].time == RoundScores[1].time)