Skip to content

Commit 453ecde

Browse files
committed
this should be it
1 parent 34ae75c commit 453ecde

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

‎src/server/game/AI/CoreAI/GuardAI.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj)
5050
return false;
5151
}
5252

53-
void GuardAI::EnterEvadeMode(EvadeReason /*why*/)
53+
void GuardAI::EnterEvadeMode(EvadeReason why)
5454
{
5555
if (!me->IsAlive())
5656
{
@@ -66,7 +66,8 @@ void GuardAI::EnterEvadeMode(EvadeReason /*why*/)
6666
me->CombatStop(true);
6767
EngagementOver();
6868

69-
me->GetMotionMaster()->MoveTargetedHome();
69+
if (why != EVADE_REASON_VEHICLE_EVADE)
70+
me->GetMotionMaster()->MoveTargetedHome();
7071
}
7172

7273
void GuardAI::JustDied(Unit* killer)

‎src/server/game/AI/CreatureAI.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ void CreatureAI::EnterEvadeMode(EvadeReason why)
218218

219219
TC_LOG_DEBUG("scripts.ai", "CreatureAI::EnterEvadeMode: entering evade mode (why: {}) ({})", why, me->GetGUID().ToString());
220220

221+
if (why == EVADE_REASON_VEHICLE_EVADE)
222+
{
223+
Reset();
224+
return;
225+
}
226+
221227
if (!me->GetVehicle()) // otherwise me will be in evade mode forever
222228
{
223229
if (Unit* owner = me->GetCharmerOrOwner())

‎src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,20 @@ void EscortAI::ReturnToLastPoint()
9393
me->GetMotionMaster()->MovePoint(POINT_LAST_POINT, me->GetHomePosition());
9494
}
9595

96-
void EscortAI::EnterEvadeMode(EvadeReason /*why*/)
96+
void EscortAI::EnterEvadeMode(EvadeReason why)
9797
{
9898
me->RemoveAllAuras();
9999
me->CombatStop(true);
100100
me->SetLootRecipient(nullptr);
101101

102102
EngagementOver();
103103

104+
if (why == EVADE_REASON_VEHICLE_EVADE)
105+
{
106+
Reset();
107+
return;
108+
}
109+
104110
if (HasEscortState(STATE_ESCORT_ESCORTING))
105111
{
106112
AddEscortState(STATE_ESCORT_RETURNING);

‎src/server/game/AI/SmartScripts/SmartAI.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void SmartAI::MovementInform(uint32 type, uint32 id)
393393
_OOCReached = true;
394394
}
395395

396-
void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
396+
void SmartAI::EnterEvadeMode(EvadeReason why)
397397
{
398398
if (_evadeDisabled)
399399
{
@@ -416,6 +416,9 @@ void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
416416

417417
SetRun(_run);
418418

419+
if (why == EVADE_REASON_VEHICLE_EVADE)
420+
return;
421+
419422
if (Unit* owner = me->GetCharmerOrOwner())
420423
{
421424
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);

0 commit comments

Comments
 (0)