From 306ea295eef03b23882fc4bfa5343b72cb8c4067 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 18 Mar 2014 18:49:36 +0100 Subject: MADS: Add isInInventory() --- engines/mads/inventory.cpp | 3 +++ engines/mads/inventory.h | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'engines') diff --git a/engines/mads/inventory.cpp b/engines/mads/inventory.cpp index 89eaaadb1b..f1a2537d42 100644 --- a/engines/mads/inventory.cpp +++ b/engines/mads/inventory.cpp @@ -88,5 +88,8 @@ bool InventoryObjects::isInRoom(int objectId) const { return (*this)[objectId]._roomNumber == _vm->_game->_scene._currentSceneId; } +bool InventoryObjects::isInInventory(int objectId) const { + return (*this)[objectId]._roomNumber == PLAYER_INVENTORY; +} } // End of namespace MADS diff --git a/engines/mads/inventory.h b/engines/mads/inventory.h index 1eef0f7f82..1ff38abb60 100644 --- a/engines/mads/inventory.h +++ b/engines/mads/inventory.h @@ -87,6 +87,11 @@ public: * Returns true if a given object is in the player's current scene */ bool isInRoom(int objectId) const; + + /** + * Returns true if a given object is in the player's inventory + */ + bool isInInventory(int objectId) const; }; } // End of namespace MADS -- cgit v1.2.3