aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo/tattoo_talk.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-06 21:40:35 -0400
committerPaul Gilbert2015-08-06 21:40:35 -0400
commit59bc9f846d639c2794ec41065092e49e8458c5f9 (patch)
treeede98a2958aa3da90e6f74705d045f71d3fe7a41 /engines/sherlock/tattoo/tattoo_talk.cpp
parentb2e98f4f52341c049df90d3410ff05f806bf1100 (diff)
downloadscummvm-rg350-59bc9f846d639c2794ec41065092e49e8458c5f9.tar.gz
scummvm-rg350-59bc9f846d639c2794ec41065092e49e8458c5f9.tar.bz2
scummvm-rg350-59bc9f846d639c2794ec41065092e49e8458c5f9.zip
SHERLOCK: RT: Properly implement cmdWalkHolmesAndNPCToCoords
Diffstat (limited to 'engines/sherlock/tattoo/tattoo_talk.cpp')
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 260aee8857..0d385008b3 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -862,13 +862,21 @@ OpcodeReturn TattooTalk::cmdWalkHomesAndNPCToCoords(const byte *&str) {
person.pushNPCPath();
person._npcMoved = true;
+ // Get destination position and facing for Holmes
int xp = (str[0] - 1) * 256 + str[1] - 1;
if (xp > 16384)
xp = -1 * (xp - 16384);
int yp = (str[2] - 1) * 256 + str[3] - 1;
+ PositionFacing holmesDest(xp * FIXED_INT_MULTIPLIER, yp * FIXED_INT_MULTIPLIER, DIRECTION_CONVERSION[str[4] - 1]);
- person.walkToCoords(Point32(xp * FIXED_INT_MULTIPLIER, yp * FIXED_INT_MULTIPLIER),
- DIRECTION_CONVERSION[str[4] - 1]);
+ // Get destination position and facing for specified NPC
+ xp = (str[5] - 1) * 256 + str[6] - 1;
+ if (xp > 16384)
+ xp = -1 * (xp - 16384);
+ yp = (str[7] - 1) * 256 + str[8] - 1;
+ PositionFacing npcDest(xp * FIXED_INT_MULTIPLIER, yp * FIXED_INT_MULTIPLIER, DIRECTION_CONVERSION[str[9] - 1]);
+
+ person.walkBothToCoords(holmesDest, npcDest);
if (_talkToAbort)
return RET_EXIT;