mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9209] Finish synchonization walk mode for pets.
* Re-sync at follow mode switches * Support sync for creature pets Also * Attempt fix build at *nix * Drop unused unut state mask with typo in name.
This commit is contained in:
parent
6a2e8064f1
commit
e1d0c1cdba
9 changed files with 62 additions and 27 deletions
|
|
@ -226,10 +226,23 @@ void ChaseMovementGenerator<T>::Reset(T &owner)
|
|||
}
|
||||
|
||||
//-----------------------------------------------//
|
||||
template<>
|
||||
void FollowMovementGenerator<Creature>::_updateWalkMode(Creature &u)
|
||||
{
|
||||
if (i_target.isValid() && u.isPet())
|
||||
u.UpdateWalkMode(i_target.getTarget());
|
||||
}
|
||||
|
||||
template<>
|
||||
void FollowMovementGenerator<Player>::_updateWalkMode(Player &)
|
||||
{
|
||||
}
|
||||
|
||||
template<>
|
||||
void FollowMovementGenerator<Player>::Initialize(Player &owner)
|
||||
{
|
||||
owner.addUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
_updateWalkMode(owner);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
|
|
@ -237,6 +250,7 @@ template<>
|
|||
void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
{
|
||||
owner.addUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
_updateWalkMode(owner);
|
||||
|
||||
if (((Creature*)&owner)->canFly())
|
||||
owner.AddMonsterMoveFlag(MONSTER_MOVE_FLY);
|
||||
|
|
@ -248,12 +262,14 @@ template<class T>
|
|||
void FollowMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
_updateWalkMode(owner);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void FollowMovementGenerator<T>::Interrupt(T &owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
_updateWalkMode(owner);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue