aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-03 00:24:07 -0500
committermegamage <none@none>2009-06-03 00:24:07 -0500
commit297ce013a841731e83fd8169ba1de65f4419eef0 (patch)
tree808a32d9c0eebcd43c6f793ef30b05bce2c18161 /src/game/Unit.cpp
parent7e3bb5c2d43faac7ee8d32892840b070f8beaf92 (diff)
*Disable vehicle/creature driver movement when entering vehicle.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 9bef10368d8..dd589023c47 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11655,7 +11655,10 @@ void Unit::RemoveFromWorld()
ExitVehicle();
if(GetCharmerGUID())
+ {
sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry());
+ assert(false);
+ }
WorldObject::RemoveFromWorld();
}
@@ -11701,7 +11704,7 @@ void Unit::UpdateCharmAI()
if(isCharmed())
{
i_disabledAI = i_AI;
- if(isPossessed())
+ if(isPossessed() || ((Creature*)this)->isVehicle())
i_AI = new PossessedAI((Creature*)this);
else
i_AI = new PetAI((Creature*)this);
@@ -14000,7 +14003,7 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
return;
for(ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
- if((*itr)->GetOwnerGUID() == GetGUID())
+ if((*itr)->GetTypeId() == TYPEID_UNIT)
(*itr)->SetPhaseMask(newPhaseMask,true);
for(int8 i = 0; i < MAX_SUMMON_SLOT; ++i)