Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SHERLOCK: RT: Fix NPC movement to original pos in pullNPCStack

commit 1e3313580f5e4fff2896c5a02214775c399a4c9b 1 parent e00a9f3
@dreammaster dreammaster authored
View
11 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;
View
4 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);
};
Please sign in to comment.
Something went wrong with that request. Please try again.