aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Unit.cpp5
-rw-r--r--src/game/Vehicle.cpp3
2 files changed, 7 insertions, 1 deletions
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()
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index 4dd38e9d41e..1a8118c7990 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -52,6 +52,9 @@ void Vehicle::RemoveFromWorld()
void Vehicle::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState
{
+ if(Unit *charmer = GetCharmer())
+ if(charmer->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)charmer)->ExitVehicle(this);
Creature::setDeathState(s);
}