[Scummvm-cvs-logs] scummvm master -> 1e3313580f5e4fff2896c5a02214775c399a4c9b

dreammaster dreammaster at scummvm.org
Sun Aug 2 20:22:58 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1e3313580f SHERLOCK: RT: Fix NPC movement to original pos in pullNPCStack


Commit: 1e3313580f5e4fff2896c5a02214775c399a4c9b
    https://github.com/scummvm/scummvm/commit/1e3313580f5e4fff2896c5a02214775c399a4c9b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-02T14:21:58-04:00

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

Changed paths:
    engines/sherlock/tattoo/tattoo_people.cpp
    engines/sherlock/tattoo/tattoo_people.h



diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp
index 31aa333..f74796e 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 0983ca4..06c6776 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);
 };
 






More information about the Scummvm-git-logs mailing list