aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-06 19:04:44 +0200
committerQAston <none@none>2009-07-06 19:04:44 +0200
commit5e51b3d7cb15693ca3dedf370fa396d1bb08a611 (patch)
treed447e682d5061530b3dba4bfea234d55849d992e /src
parent855c0dc3b21c875338c772b7532f228b8702b21b (diff)
*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
Diffstat (limited to 'src')
-rw-r--r--src/game/DestinationHolderImp.h2
-rw-r--r--src/game/PointMovementGenerator.cpp3
-rw-r--r--src/game/Unit.cpp3
3 files changed, 5 insertions, 3 deletions
diff --git a/src/game/DestinationHolderImp.h b/src/game/DestinationHolderImp.h
index d50d8c3e727..c84ce19a96d 100644
--- a/src/game/DestinationHolderImp.h
+++ b/src/game/DestinationHolderImp.h
@@ -142,7 +142,7 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
i_fromZ = z;
}
- if( traveller.GetTraveller().GetPositionX() != x || traveller.GetTraveller().GetPositionY() != y )
+ if( traveller.GetTraveller().GetPositionX() != x || traveller.GetTraveller().GetPositionY() != y || traveller.GetTraveller().GetPositionZ() != z)
{
float ori = traveller.GetTraveller().GetAngle(x, y);
traveller.Relocation(x, y, z, ori);
diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp
index ed057854aaa..24baa4939b4 100644
--- a/src/game/PointMovementGenerator.cpp
+++ b/src/game/PointMovementGenerator.cpp
@@ -32,7 +32,8 @@ void PointMovementGenerator<T>::Initialize(T &unit)
unit.StopMoving();
unit.clearUnitState(UNIT_STAT_MOVING);
Traveller<T> traveller(unit);
- i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, !unit.hasUnitState(UNIT_STAT_JUMPING));
+ // knockback effect has UNIT_STAT_JUMPING set,so if here we disable sentmonstermove there will be creature position sync problem between client and server
+ i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.hasUnitState(UNIT_STAT_JUMPING)*/);
if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly())
unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
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 )
{