From dcd33889d41a33d591fa7499c67e646951b0627d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Jul 2015 12:11:44 -0400 Subject: SHERLOCK: RT: Cleanup of cmdWalkHolmesToCoords --- engines/sherlock/tattoo/tattoo_talk.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp index e61873ced9..d0c4bdc3b0 100644 --- a/engines/sherlock/tattoo/tattoo_talk.cpp +++ b/engines/sherlock/tattoo/tattoo_talk.cpp @@ -239,15 +239,15 @@ OpcodeReturn TattooTalk::cmdWalkHolmesToCoords(const byte *&str) { People &people = *_vm->_people; ++str; - int x = (str[0] - 1) * 256 + str[1] - 1; - if (x > 16384) - x = -1 * (x - 16384); - warning("TODO: cmdWalkHolmesToCoords - call RT walkToCoords variant"); - people[HOLMES].walkToCoords( - Point32(x * FIXED_INT_MULTIPLIER, ((str[2] - 1) * 256 + str[3] - 1) * FIXED_INT_MULTIPLIER), - DIRECTION_CONVERSION[str[4] - 1] - //HOLMES - ); + int xp = (str[0] - 1) * 256 + str[1] - 1; + if (xp > 16384) + // Negative X + xp = -1 * (xp - 16384); + int yp = (str[2] - 1) * 256 + str[3] - 1; + + people[HOLMES].walkToCoords(Point32(xp * FIXED_INT_MULTIPLIER, yp * FIXED_INT_MULTIPLIER), + DIRECTION_CONVERSION[str[4] - 1]); + if (_talkToAbort) return RET_EXIT; -- cgit v1.2.3