mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11756] Call MovementInform at arrive in effect movement generator, move class to more appropriate place
Signed-off-by: SilverIce <slifeleaf@gmail.com>
This commit is contained in:
parent
eed25030b7
commit
0b26ca38a7
5 changed files with 41 additions and 26 deletions
|
|
@ -119,3 +119,25 @@ void AssistanceMovementGenerator::Finalize(Unit &unit)
|
|||
if (unit.isAlive())
|
||||
unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_ASSISTANCE_DELAY));
|
||||
}
|
||||
|
||||
bool EffectMovementGenerator::Update(Unit &unit, const uint32 &)
|
||||
{
|
||||
return !unit.movespline->Finalized();
|
||||
}
|
||||
|
||||
void EffectMovementGenerator::Finalize(Unit &unit)
|
||||
{
|
||||
if (unit.GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
if (((Creature&)unit).AI() && unit.movespline->Finalized())
|
||||
((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id);
|
||||
// Need restore previous movement since we have no proper states system
|
||||
if (unit.isAlive() && !unit.hasUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_FLEEING))
|
||||
{
|
||||
if (Unit * victim = unit.getVictim())
|
||||
unit.GetMotionMaster()->MoveChase(victim);
|
||||
else
|
||||
unit.GetMotionMaster()->Initialize();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue