From 4344b2f8c8fd34994f28e86d7707f7803a811c61 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Tue, 25 Jun 2019 11:00:50 +0530 Subject: HDB: Add getInvItem() --- engines/hdb/ai-inventory.cpp | 6 ++++++ engines/hdb/ai.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'engines') diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp index 25376bf513..09fee3b5b8 100644 --- a/engines/hdb/ai-inventory.cpp +++ b/engines/hdb/ai-inventory.cpp @@ -98,4 +98,10 @@ void AI::clearInventory() { } _numInventory = keepslot; } + +AIEntity *AI::getInvItem(int which) { + if (which >= _numInventory) + return NULL; + return _inventory[which].ent; +} } // End of Namespace diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 815a1ef3a9..4f18a57190 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -835,6 +835,8 @@ public: _numGems = amt; } + AIEntity *getInvItem(int which); + // Player Variables bool _playerDead; bool _playerInvisible; // While on RailRider for example -- cgit v1.2.3