Skip to content

Commit

Permalink
SHERLOCK: RT: Fix Holmes walking when moving to talk to character
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jul 13, 2015
1 parent 5b7dc80 commit 918f6c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions engines/sherlock/tattoo/tattoo_people.cpp
Expand Up @@ -1049,23 +1049,23 @@ void TattooPerson::walkHolmesToNPC() {

// See where Holmes is with respect to the NPC (x coords)
if (holmes._position.x < _position.x) {
_walkDest.x = MAX(_position.x / FIXED_INT_MULTIPLIER - imgFrame.sDrawXSize(scaleVal), 0);
holmes._walkDest.x = MAX(_position.x / FIXED_INT_MULTIPLIER - imgFrame.sDrawXSize(scaleVal), 0);
} else {
_walkDest.x = MIN(_position.x / FIXED_INT_MULTIPLIER + imgFrame.sDrawXSize(scaleVal) * 2,
holmes._walkDest.x = MIN(_position.x / FIXED_INT_MULTIPLIER + imgFrame.sDrawXSize(scaleVal) * 2,
screen._backBuffer1.w() - 1);
}

// See where Holmes is with respect to the NPC (y coords)
if (holmes._position.y < (_position.y - imgFrame.sDrawXSize(scaleVal) * 500)) {
_walkDest.y = MAX(_position.y / FIXED_INT_MULTIPLIER - imgFrame.sDrawXSize(scaleVal) / 2, 0);
holmes._walkDest.y = MAX(_position.y / FIXED_INT_MULTIPLIER - imgFrame.sDrawXSize(scaleVal) / 2, 0);
} else {
if (holmes._position.y > (_position.y + imgFrame.sDrawXSize(scaleVal) * 500)) {
// Holmes is below the NPC
_walkDest.y = MIN(_position.y / FIXED_INT_MULTIPLIER + imgFrame.sDrawXSize(scaleVal) / 2,
holmes._walkDest.y = MIN(_position.y / FIXED_INT_MULTIPLIER + imgFrame.sDrawXSize(scaleVal) / 2,
SHERLOCK_SCREEN_HEIGHT - 1);
} else {
// Holmes is roughly on the same Y as the NPC
_walkDest.y = _position.y / FIXED_INT_MULTIPLIER;
holmes._walkDest.y = _position.y / FIXED_INT_MULTIPLIER;
}
}

Expand Down

0 comments on commit 918f6c0

Please sign in to comment.