mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Movement): ResolveMovePath takes WorldPosition by value (distance() not const-safe)
This commit is contained in:
parent
c2df89f923
commit
b187031ed2
@ -3067,8 +3067,8 @@ bool MoveAwayFromPlayerWithDebuffAction::isPossible()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TravelPath MovementAction::ResolveMovePath(WorldPosition const& startPos,
|
TravelPath MovementAction::ResolveMovePath(WorldPosition startPos,
|
||||||
WorldPosition const& endPos,
|
WorldPosition endPos,
|
||||||
LastMovement& lastMove)
|
LastMovement& lastMove)
|
||||||
{
|
{
|
||||||
float const totalDistance = startPos.distance(endPos);
|
float const totalDistance = startPos.distance(endPos);
|
||||||
@ -3098,8 +3098,7 @@ TravelPath MovementAction::ResolveMovePath(WorldPosition const& startPos,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WorldPosition mutableStart = startPos;
|
std::vector<WorldPosition> probe = startPos.getPathTo(endPos, bot);
|
||||||
std::vector<WorldPosition> probe = mutableStart.getPathTo(endPos, bot);
|
|
||||||
out.addPath(probe);
|
out.addPath(probe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -94,8 +94,8 @@ protected:
|
|||||||
// graph (cross-map / >sightDistance) or live mmap probe, regression
|
// graph (cross-map / >sightDistance) or live mmap probe, regression
|
||||||
// guard preferring cached path when no better, fall back to a
|
// guard preferring cached path when no better, fall back to a
|
||||||
// single-point path on dest. Stateless — does not dispatch.
|
// single-point path on dest. Stateless — does not dispatch.
|
||||||
TravelPath ResolveMovePath(WorldPosition const& startPos,
|
TravelPath ResolveMovePath(WorldPosition startPos,
|
||||||
WorldPosition const& endPos,
|
WorldPosition endPos,
|
||||||
LastMovement& lastMove);
|
LastMovement& lastMove);
|
||||||
|
|
||||||
// Dispatches the head-of-path special segment (portal interact /
|
// Dispatches the head-of-path special segment (portal interact /
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user