aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-21 11:01:59 -0500
committermegamage <none@none>2009-08-21 11:01:59 -0500
commit6d3fd6b18988d32826ebe8b266f48f0e590b8aa7 (patch)
tree6b42f0256cd7bcb56fe460ec4133b44d159500c0
parentd8e5b86e543921606e450ebfcaa08aad02bdb3c1 (diff)
*Fix a crash caused by removing vehicles when wintergrasp battle ends.
--HG-- branch : trunk
-rw-r--r--src/game/Wintergrasp.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 6cd473ff7c7..05cfc75d350 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -736,7 +736,12 @@ void OPvPWintergrasp::EndBattle()
for(uint32 team = 0; team < 2; ++team)
{
- VehicleCastSpell(TeamId(team), SPELL_SHUTDOWN_VEHICLE);
+ while(!m_vehicles[team].empty())
+ {
+ Vehicle *veh = *m_vehicles[team].begin();
+ m_vehicles[team].erase(m_vehicles[team].begin());
+ veh->CastSpell(veh, SPELL_SHUTDOWN_VEHICLE, true);
+ }
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
{