diff options
-rw-r--r-- | engines/titanic/core/tree_item.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/core/tree_item.h | 5 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_control.h | 10 |
4 files changed, 16 insertions, 6 deletions
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp index 55deee07df..e7b61dc853 100644 --- a/engines/titanic/core/tree_item.cpp +++ b/engines/titanic/core/tree_item.cpp @@ -289,6 +289,11 @@ CRoomItem *CTreeItem::getRoom() const { return gameManager ? gameManager->getRoom() : nullptr; } +CRoomItem *CTreeItem::getHiddenRoom() const { + CProjectItem *root = getRoot(); + return root ? root->findHiddenRoom() : nullptr; +} + int CTreeItem::getState8() const { CGameManager *gameManager = getGameManager(); return gameManager ? gameManager->_gameState._field8 : 3; diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h index d710fcf0b8..9710a255d0 100644 --- a/engines/titanic/core/tree_item.h +++ b/engines/titanic/core/tree_item.h @@ -248,6 +248,11 @@ public: */ CRoomItem *getRoom() const; + /** + * Returns the special hidden room container + */ + CRoomItem *getHiddenRoom() const; + int getState8() const; int getStateC() const; }; diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index 4fe0c1d255..8376f4ac2c 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -284,7 +284,7 @@ void CPetControl::fn3(CTreeItem *item) { CRoomItem *CPetControl::getHiddenRoom() { if (!_hiddenRoom) - _hiddenRoom = getHiddenRoom(); + _hiddenRoom = CTreeItem::getHiddenRoom(); return _hiddenRoom; } diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h index 4fcfe6e7a4..ea7c6845f3 100644 --- a/engines/titanic/pet_control/pet_control.h +++ b/engines/titanic/pet_control/pet_control.h @@ -81,11 +81,6 @@ private: * Scan the specified room for an item by name */ CGameObject *findItemInRoom(CRoomItem *room, const CString &name) const; - - /** - * Returns a reference to the special hidden room container - */ - CRoomItem *getHiddenRoom(); public: PetArea _currentArea; public: @@ -150,6 +145,11 @@ public: * special hidden room container */ CGameObject *getHiddenObject(const CString &name); + + /** + * Returns a reference to the special hidden room container + */ + CRoomItem *getHiddenRoom(); }; } // End of namespace Titanic |