Permalink
Browse files

TITANIC: Only allow moving to SGT TV in assigned room

  • Loading branch information...
dreammaster committed Oct 10, 2017
1 parent 1f5908c commit 3fd2cf29b14f92015052fc85aee9299de57360e7
@@ -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());
@@ -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;
}
@@ -438,10 +438,10 @@ class CPetControl : public CGameObject {
}
/**
* 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 {
@@ -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)
@@ -164,9 +164,10 @@ class CPetRooms : public CPetSection {
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

0 comments on commit 3fd2cf2

Please sign in to comment.