diff options
author | megamage <none@none> | 2009-08-21 02:46:48 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-21 02:46:48 -0500 |
commit | 457f7971de361f05ff02ee2f9552be55867e6bf3 (patch) | |
tree | eb6db3eb086e07ed83f7406b0f330adbbc344ad4 /src/game/Unit.cpp | |
parent | f8bec55205af170e0ca6c112e6b25067115a35fc (diff) |
*Fix the bug that Eye of Acherus does not fly in some servers.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a38ea3cc0ca..b0c8262df0c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8860,6 +8860,16 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius) return nearMembers[randTarget]; } +Player * Unit::GetMoverSource() const +{ + if(GetTypeId() == TYPEID_PLAYER && ((Player*)this)->m_mover == this) + return (Player*)this; + if(Unit *charmer = GetCharmer()) + if(charmer->GetTypeId() == TYPEID_PLAYER && ((Player*)charmer)->m_mover == this) + return (Player*)charmer; + return NULL; +} + //only called in Player::SetSeer void Unit::AddPlayerToVision(Player* plr) { @@ -14725,12 +14735,12 @@ void Unit::SetFlying(bool apply) if(apply) { SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE + MOVEMENTFLAG_FLYING); } else { RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); + RemoveUnitMovementFlag(MOVEMENTFLAG_FLY_MODE + MOVEMENTFLAG_FLYING); } } |