diff options
author | Paul Gilbert | 2015-08-02 14:21:58 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-02 14:21:58 -0400 |
commit | 1e3313580f5e4fff2896c5a02214775c399a4c9b (patch) | |
tree | 4568ebe16fbdc8b2d4586ba3bb0cd1e5fc1a2f55 | |
parent | e00a9f338ca8f3e458793799f7f136eb8e7d4212 (diff) | |
download | scummvm-rg350-1e3313580f5e4fff2896c5a02214775c399a4c9b.tar.gz scummvm-rg350-1e3313580f5e4fff2896c5a02214775c399a4c9b.tar.bz2 scummvm-rg350-1e3313580f5e4fff2896c5a02214775c399a4c9b.zip |
SHERLOCK: RT: Fix NPC movement to original pos in pullNPCStack
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.cpp | 11 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.h | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index 31aa3335d7..f74796e834 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -98,8 +98,8 @@ SavedNPCPath::SavedNPCPath() { _lookHolmes = false; } -SavedNPCPath::SavedNPCPath(byte path[MAX_NPC_PATH], int npcIndex, int npcPause, const Common::Point &walkDest, - int npcFacing, bool lookHolmes) : _npcIndex(npcIndex), _npcPause(npcPause), _walkDest(walkDest), +SavedNPCPath::SavedNPCPath(byte path[MAX_NPC_PATH], int npcIndex, int npcPause, const Point32 &position, + int npcFacing, bool lookHolmes) : _npcIndex(npcIndex), _npcPause(npcPause), _position(position), _npcFacing(npcFacing), _lookHolmes(lookHolmes) { Common::copy(&path[0], &path[MAX_NPC_PATH], &_path[0]); } @@ -847,13 +847,12 @@ void TattooPerson::pullNPCPath() { // Handle the first case if the NPC was paused if (_npcPause) { - _walkDest = Common::Point(path._walkDest.x / FIXED_INT_MULTIPLIER, path._walkDest.y / FIXED_INT_MULTIPLIER); _npcFacing = path._npcFacing; _lookHolmes = path._lookHolmes; - // See if the NPC was moved - if (_walkDest.x != (_position.x / FIXED_INT_MULTIPLIER) || - _walkDest.y != (_position.y / FIXED_INT_MULTIPLIER)) { + // See if the NPC has moved from where they originally were + if (path._position != _position) { + _walkDest = Point32(path._position.x / FIXED_INT_MULTIPLIER, path._position.y / FIXED_INT_MULTIPLIER); goAllTheWay(); _npcPause = 0; _npcIndex -= 3; diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h index 0983ca4dcc..06c6776314 100644 --- a/engines/sherlock/tattoo/tattoo_people.h +++ b/engines/sherlock/tattoo/tattoo_people.h @@ -88,12 +88,12 @@ struct SavedNPCPath { byte _path[MAX_NPC_PATH]; int _npcIndex; int _npcPause; - Common::Point _walkDest; + Point32 _position; int _npcFacing; bool _lookHolmes; SavedNPCPath(); - SavedNPCPath(byte path[MAX_NPC_PATH], int npcIndex, int npcPause, const Common::Point &walkDest, + SavedNPCPath(byte path[MAX_NPC_PATH], int npcIndex, int npcPause, const Point32 &position, int npcFacing, bool lookHolmes); }; |