diff options
author | Andrew Kurushin | 2005-07-03 15:22:59 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-07-03 15:22:59 +0000 |
commit | 1fd2c55051821557f158fbabf8a8471a1dfa69ab (patch) | |
tree | ba264f5e6a96ab87c2864a27e5f2516561e0b36c | |
parent | 339d20eac8d73a3e656e4cc207141ef2c79d0088 (diff) | |
download | scummvm-rg350-1fd2c55051821557f158fbabf8a8471a1dfa69ab.tar.gz scummvm-rg350-1fd2c55051821557f158fbabf8a8471a1dfa69ab.tar.bz2 scummvm-rg350-1fd2c55051821557f158fbabf8a8471a1dfa69ab.zip |
fixed Elara bug
svn-id: r18486
-rw-r--r-- | saga/actor.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index 44994e6d87..5109293e5b 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -987,8 +987,7 @@ void Actor::handleActions(int msec, bool setup) { speed = 1; } - if ((actor->actionDirection == kDirUp) || (actor->actionDirection == kDirDown)) { - // move by 2's in vertical dimension + if ((actor->actionDirection == kDirUp) || (actor->actionDirection == kDirDown)) { addDelta.y = clamp(-speed, delta.y, speed); if (addDelta.y == delta.y) { addDelta.x = delta.x; @@ -1647,10 +1646,12 @@ bool Actor::actorWalkTo(uint16 actorId, const Location &toLocation) { } else { actor->location.toScreenPointXY(pointFrom); + pointFrom.x &= ~1; extraStartNode = _vm->_scene->offscreenPath(pointFrom); toLocation.toScreenPointXY(pointTo); + pointTo.x &= ~1; extraEndNode = _vm->_scene->offscreenPath(pointTo); @@ -1700,19 +1701,21 @@ bool Actor::actorWalkTo(uint16 actorId, const Location &toLocation) { anotherActorScreenPosition = anotherActor->screenPosition; - testBox.left = anotherActorScreenPosition.x - collision.x; - testBox.right = anotherActorScreenPosition.x + collision.x + 1; + testBox.left = (anotherActorScreenPosition.x - collision.x) & ~1; + testBox.right = (anotherActorScreenPosition.x + collision.x) & ~1 + 1; testBox.top = anotherActorScreenPosition.y - collision.y; testBox.bottom = anotherActorScreenPosition.y + collision.y + 1; testBox2 = testBox; - testBox2.right += 1; - testBox2.left -= 1; + testBox2.right += 2; + testBox2.left -= 2; + testBox2.top -= 1; + testBox2.bottom += 1; if (testBox2.contains(pointFrom)) { if (pointFrom.x > anotherActorScreenPosition.x + 4) { testBox.right = pointFrom.x - 1; } else { - if (pointFrom.x < anotherActorScreenPosition.x - 4) { + if (pointFrom.x < anotherActorScreenPosition.x - 4) { testBox.left = pointFrom.x + 2; } else { if (pointFrom.y > anotherActorScreenPosition.y) { @@ -1754,7 +1757,6 @@ bool Actor::actorWalkTo(uint16 actorId, const Location &toLocation) { pointBest = actor->walkStepsPoints[actor->walkStepsCount - 1]; - pointFrom.x &= ~1; delta.x = ABS(pointFrom.x - pointTo.x); delta.y = ABS(pointFrom.y - pointTo.y); |