*Use virtual function for GetFollowAngle

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-23 09:17:35 +08:00
parent a522e3bff4
commit e79656b75a
3 changed files with 2 additions and 11 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ class Minion : public TempSummon
void InitSummon();
void RemoveFromWorld();
Unit *GetOwner() { return m_owner; }
float GetFollowAngle() { return m_followAngle; }
float GetFollowAngle() const { return m_followAngle; }
void SetFollowAngle(float angle) { m_followAngle = angle; }
bool IsPetGhoul() const {return GetEntry() == 26125;} // Ghoul may be guardian or pet
protected:
-9
View File
@@ -14906,15 +14906,6 @@ void Unit::SetFlying(bool apply)
}
}
float Unit::GetFollowAngle() const
{
if (GetTypeId()!=TYPEID_UNIT)
return PET_FOLLOW_ANGLE;
if (!((Creature*)this)->HasSummonMask(SUMMON_MASK_MINION))
return PET_FOLLOW_ANGLE;
return ((Minion*)this)->GetFollowAngle();
}
void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ )
{
if(GetTypeId() == TYPEID_PLAYER)
+1 -1
View File
@@ -1805,7 +1805,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool canFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLY_MODE); }
bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING); }
void SetFlying(bool apply);
float GetFollowAngle() const;
virtual float GetFollowAngle() const { return M_PI/2; }
protected:
explicit Unit ();