Skip to content

Commit

Permalink
MoveNearerTo: fixed sign mistake, fixes #1897
Browse files Browse the repository at this point in the history
we were checking for one distance and then sometimes stopping a few feet
too short, dropping ranged actions

problem was there since introduction in 2009
  • Loading branch information
lynxlynxlynx committed Apr 1, 2024
1 parent 5d28544 commit ea5f73d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gemrb/core/GameScript/GSUtils.cpp
Expand Up @@ -1922,10 +1922,10 @@ void MoveNearerTo(Scriptable *Sender, const Scriptable *target, int distance, in

// account for PersonalDistance (which caller uses, but pathfinder doesn't)
if (distance) {
distance += mover->CircleSize2Radius() * 4; // DistanceFactor
distance -= mover->CircleSize2Radius() * 4; // DistanceFactor
}
if (distance && target->Type == ST_ACTOR) {
distance += static_cast<const Actor*>(target)->CircleSize2Radius() * 4;
distance -= static_cast<const Actor*>(target)->CircleSize2Radius() * 4;
}

MoveNearerTo(Sender, p, distance, dont_release);
Expand Down

0 comments on commit ea5f73d

Please sign in to comment.