aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-14 20:15:47 +0200
committerQAston <none@none>2009-07-14 20:15:47 +0200
commit8898e9f4204aa5195237df9ae6d804455e8e2c38 (patch)
treeabac636389ada8d5f5aa4b8a46626d1e768beacb /src/game/Unit.cpp
parent87ca52c2a9c77db7b9a3f6a4d4f7f12b57b854a5 (diff)
*Fix the bug that escorted creatures return to their spawnpoint after engaging combat.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e55b54996f0..eede4b4bed2 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10536,9 +10536,10 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if(GetTypeId() != TYPEID_PLAYER)
{
- //if(GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != IDLE_MOTION_TYPE)
- //if (((Creature *)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
- //((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ // Set home position at place of engaging combat for escorted creatures
+ if(((Creature*)this)->IsAIEnabled)
+ if (((Creature *)this)->AI()->IsEscorted())
+ ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
if(enemy)
{
if(((Creature*)this)->IsAIEnabled)