From 3fd2cf29b14f92015052fc85aee9299de57360e7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Oct 2017 19:19:46 -0400 Subject: TITANIC: Only allow moving to SGT TV in assigned room --- engines/titanic/pet_control/pet_control.h | 6 +++--- engines/titanic/pet_control/pet_rooms.cpp | 2 +- engines/titanic/pet_control/pet_rooms.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'engines/titanic/pet_control') diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h index 6408c8a29b..a95b896159 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 45ed209d5c..8fa0f6b4f8 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(*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 ecfeadf2b9..a893e9a49d 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 -- cgit v1.2.3