diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2019-07-21 03:59:17 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2019-07-21 03:59:43 +0200 |
| commit | 49b04c0fdd03d060d10f91a597857ec9c3d9f4ed (patch) | |
| tree | da96e83757f089daddbe00381bd9d1f46f10bfaf /src/server/game/AI/CreatureAI.cpp | |
| parent | e5615402cc2dbc8cea6ffada0d759a7feeacb4b7 (diff) | |
Core/AI: No longer override chase movement with follow movement if the creature engages before JustAppeared has had a chance to fire.
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
| -rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 93c0076a2fa..760517851f6 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -186,15 +186,18 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties) void CreatureAI::JustAppeared() { - if (TempSummon* summon = me->ToTempSummon()) + if (!IsEngaged()) { - // Only apply this to specific types of summons - if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties)) + if (TempSummon* summon = me->ToTempSummon()) { - if (Unit* owner = summon->GetCharmerOrOwner()) + // Only apply this to specific types of summons + if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties)) { - summon->GetMotionMaster()->Clear(); - summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle()); + if (Unit* owner = summon->GetCharmerOrOwner()) + { + summon->GetMotionMaster()->Clear(); + summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle()); + } } } } |
