[Scummvm-git-logs] scummvm master -> 3fd2cf29b14f92015052fc85aee9299de57360e7

dreammaster dreammaster at scummvm.org
Wed Oct 11 01:19:50 CEST 2017


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:
3fd2cf29b1 TITANIC: Only allow moving to SGT TV in assigned room


Commit: 3fd2cf29b14f92015052fc85aee9299de57360e7
    https://github.com/scummvm/scummvm/commit/3fd2cf29b14f92015052fc85aee9299de57360e7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-10-10T19:19:46-04:00

Commit Message:
TITANIC: Only allow moving to SGT TV in assigned room

Changed paths:
    engines/titanic/game/ear_sweet_bowl.cpp
    engines/titanic/game/sgt/sgt_nav.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h


diff --git a/engines/titanic/game/ear_sweet_bowl.cpp b/engines/titanic/game/ear_sweet_bowl.cpp
index 387392b..e9190c3 100644
--- a/engines/titanic/game/ear_sweet_bowl.cpp
+++ b/engines/titanic/game/ear_sweet_bowl.cpp
@@ -49,7 +49,7 @@ bool CEarSweetBowl::MovieEndMsg(CMovieEndMsg *msg) {
 	if (!doneMsg._value) {
 		CPetControl *pet = getPetControl();
 		if (pet)
-			pet->hasRoomFlags();
+			pet->isInAssignedRoom();
 
 		CIsParrotPresentMsg parrotMsg;
 		parrotMsg.execute(findRoom());
diff --git a/engines/titanic/game/sgt/sgt_nav.cpp b/engines/titanic/game/sgt/sgt_nav.cpp
index 3be92b4..904ce64 100644
--- a/engines/titanic/game/sgt/sgt_nav.cpp
+++ b/engines/titanic/game/sgt/sgt_nav.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game/sgt/sgt_nav.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -43,7 +44,9 @@ bool SGTNav::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	CTurnOn onMsg;
 	CTurnOff offMsg;
 
-	if (_statics->_chestOfDrawers == "Open" && _statics->_bedhead == "Open") {
+	CPetControl *pet = getPetControl();
+	if (_statics->_chestOfDrawers == "Open" && _statics->_bedhead == "Open"
+			&& pet->isInAssignedRoom()) {
 		if (_statics->_vase == "Open")
 			offMsg.execute("Vase");
 		if (_statics->_tv == "Closed")
@@ -68,10 +71,14 @@ bool SGTNav::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool SGTNav::MouseMoveMsg(CMouseMoveMsg *msg) {
-	if (_statics->_chestOfDrawers == "Open" && _statics->_bedhead == "Open")
-		_cursorId = CURSOR_MOVE_FORWARD;
-	else
-		_cursorId = CURSOR_ARROW;
+	_cursorId = CURSOR_ARROW;
+
+	if (_statics->_chestOfDrawers == "Open" && _statics->_bedhead == "Open") {
+		CPetControl *pet = getPetControl();
+		if (pet->isInAssignedRoom()) {
+			_cursorId = CURSOR_MOVE_FORWARD;
+		}
+	}
 
 	return true;
 }
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 6408c8a..a95b896 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -438,10 +438,10 @@ public:
 	}
 
 	/**
-	 * Returns true if the Rooms list has a room with the given flags
+	 * Returns true if the player is in the current or previously assigned rooms
 	 */
-	bool hasRoomFlags() const {
-		return _rooms.hasRoomFlags(getRoomFlags());
+	bool isInAssignedRoom() const {
+		return _rooms.isAssignedRoom(getRoomFlags());
 	}
 
 	uint getRoomFlags() const {
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 45ed209..8fa0f6b 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -339,7 +339,7 @@ bool CPetRooms::changeLocationClass(PassengerClass newClassNum) {
 	return true;
 }
 
-bool CPetRooms::hasRoomFlags(uint roomFlags) const {
+bool CPetRooms::isAssignedRoom(uint roomFlags) const {
 	for (CPetRoomsGlyphs::const_iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
 		const CPetRoomsGlyph *glyph = static_cast<const CPetRoomsGlyph *>(*i);
 		if (glyph->isAssigned() && glyph->getRoomFlags() == roomFlags)
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index ecfeadf..a893e9a 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -164,9 +164,10 @@ public:
 	bool changeLocationClass(PassengerClass newClassNum);
 
 	/**
-	 * Returns true if a room glyph exists with the given flags
+	 * Returns true if the specified location is the current or
+	 * previously assigned room
 	 */
-	bool hasRoomFlags(uint roomFlags) const;
+	bool isAssignedRoom(uint roomFlags) const;
 
 	/**
 	 * Returns the room flags for the player's currently assigned room





More information about the Scummvm-git-logs mailing list