From 5e51b3d7cb15693ca3dedf370fa396d1bb08a611 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 6 Jul 2009 19:04:44 +0200 Subject: *Fix client-server movement sync after knockback effect - by smellbee *Fix the bug that sometimes creature don't evade, and chase for player to death - by smellbee *Do not set creature home position to place of engaging in combat --HG-- branch : trunk --- src/game/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 33a6c55433f..a2d899a4cac 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10526,6 +10526,7 @@ 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()); if(enemy) { @@ -11291,7 +11292,7 @@ Unit* Creature::SelectVictim() // it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list // for example at owner command to pet attack some far away creature // Note: creature not have targeted movement generator but have attacker in this case - if(m_attackers.size()) + if(m_attackers.size() && m_ThreatManager.isThreatListEmpty()) //there are some cases null target are always returned,so creature evade can not be called at all. such as pull creature at a distance beyond the attackdist to the attacker return NULL; /*if( GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE ) { -- cgit v1.2.3