Fix Charge bug (#125)
* Fix "You are in combat" bug. Ideas taken from TC * Correct previous commit. * Improved previous commits - Creatures in dungeons will not remove distant players from their threat list - Creatures in non dungeon maps will properly remove the distant players from their threat lists and also players auras from them * Fix previous commit. -The creatures will remain tapped by the initial attacker. -Fix the loot bug * Fix Charge bug. -Corrected WorldObject::GetContactPoint to proper compute the final destination point. -Corrected WorldObject::UpdateAllowedPositionZ to proper adjust the Z value -Limit the path length computed for EffectCharge. In the event the path cannot be computed, a linear path is applied.
This commit is contained in:
parent
105ded0cda
commit
6bc64bf5c4
@ -1315,8 +1315,6 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap
|
|||||||
{
|
{
|
||||||
if (z > max_z)
|
if (z > max_z)
|
||||||
{ z = max_z; }
|
{ z = max_z; }
|
||||||
else if (z < ground_z)
|
|
||||||
{ z = ground_z; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1337,8 +1335,6 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap
|
|||||||
{
|
{
|
||||||
if (z > max_z)
|
if (z > max_z)
|
||||||
{ z = max_z; }
|
{ z = max_z; }
|
||||||
else if (z < ground_z)
|
|
||||||
{ z = ground_z; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -533,7 +533,7 @@ class WorldObject : public Object
|
|||||||
void GetContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d = CONTACT_DISTANCE) const
|
void GetContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d = CONTACT_DISTANCE) const
|
||||||
{
|
{
|
||||||
// angle to face `obj` to `this` using distance includes size of `obj`
|
// angle to face `obj` to `this` using distance includes size of `obj`
|
||||||
GetNearPoint(obj, x, y, z, obj->GetObjectBoundingRadius(), distance2d + GetObjectBoundingRadius() + obj->GetObjectBoundingRadius(), GetAngle(obj));
|
GetNearPoint(obj, x, y, z, obj->GetObjectBoundingRadius(), distance2d, GetAngle(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual float GetObjectBoundingRadius() const { return DEFAULT_WORLD_OBJECT_SIZE; }
|
virtual float GetObjectBoundingRadius() const { return DEFAULT_WORLD_OBJECT_SIZE; }
|
||||||
|
@ -9169,7 +9169,7 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas
|
|||||||
void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath, bool forceDestination)
|
void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath, bool forceDestination)
|
||||||
{
|
{
|
||||||
Movement::MoveSplineInit init(*this);
|
Movement::MoveSplineInit init(*this);
|
||||||
init.MoveTo(x, y, z, generatePath, forceDestination);
|
init.MoveTo(x, y, z, generatePath, forceDestination, 30.f);
|
||||||
init.SetVelocity(speed);
|
init.SetVelocity(speed);
|
||||||
init.Launch();
|
init.Launch();
|
||||||
}
|
}
|
||||||
|
@ -237,14 +237,15 @@ namespace Movement
|
|||||||
path.setPathLengthLimit(maxPathRange);
|
path.setPathLengthLimit(maxPathRange);
|
||||||
}
|
}
|
||||||
path.calculate(dest.x, dest.y, dest.z, forceDestination);
|
path.calculate(dest.x, dest.y, dest.z, forceDestination);
|
||||||
MovebyPath(path.getPath());
|
if (!(path.getPathType() & PATHFIND_NOPATH))
|
||||||
}
|
{
|
||||||
else
|
MovebyPath(path.getPath());
|
||||||
{
|
return;
|
||||||
args.path_Idx_offset = 0;
|
}
|
||||||
args.path.resize(2);
|
|
||||||
args.path[1] = dest;
|
|
||||||
}
|
}
|
||||||
|
args.path_Idx_offset = 0;
|
||||||
|
args.path.resize(2);
|
||||||
|
args.path[1] = dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user