diff options
author | megamage <none@none> | 2009-01-04 10:51:41 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-04 10:51:41 -0600 |
commit | a7cc53d2620512548feb23446f469326110fb859 (patch) | |
tree | fe1f4c67f13bf201cef6bd59b27329692c0fd41c /src | |
parent | 92532d99eee896403e851c0095c3ffb04d99b18b (diff) |
*Fix the bug that creature do not return to home position.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index cb52b70a271..210060982a4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8172,7 +8172,6 @@ bool Unit::Attack(Unit *victim, bool meleeAttack) ((WorldObject*)this)->SendMessageToSet(&data, true); ((Creature*)this)->CallAssistance(); - ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); } // delay offhand weapon attack to next attack time @@ -9765,6 +9764,9 @@ void Unit::SetInCombatState(bool PvP) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + if(GetTypeId() != TYPEID_PLAYER) + ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); + if(GetTypeId() != TYPEID_PLAYER && ((Creature*)this)->isPet()) { UpdateSpeed(MOVE_RUN, true); |