From 6e33427a114e9702f1152cc70b8316ce43b56e13 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 28 Mar 2009 10:50:54 -0600 Subject: *Exit vehicle when players or vehicles are dead. This may fix some crash. --HG-- branch : trunk --- src/game/Unit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 7b97c74172f..056c2fa8952 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8417,13 +8417,16 @@ Unit* Unit::GetFirstControlled() const void Unit::RemoveAllControlled() { + //possessed pet and vehicle + if(GetTypeId() == TYPEID_PLAYER) + ((Player*)this)->StopCastingCharm(); + while(!m_Controlled.empty()) { Unit *target = *m_Controlled.begin(); m_Controlled.erase(m_Controlled.begin()); if(target->GetCharmerGUID() == GetGUID()) { - //TODO: possessed and vehicle target->RemoveCharmAuras(); } else if(target->GetOwnerGUID() == GetGUID() -- cgit v1.2.3