diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/ai-inventory.cpp | 17 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp index ea23dd2295..dd4e6ae3cc 100644 --- a/engines/hdb/ai-inventory.cpp +++ b/engines/hdb/ai-inventory.cpp @@ -79,4 +79,21 @@ bool AI::addToInventory(AIEntity *e) { return true; } +// Clear out the Player inventory except Gems, +// Monkeystones and Goo Cups unless its marked +void AI::clearInventory() { + int keepslot = 0; + for (int i = 0; i < _numInventory; i++) { + if (!_inventory[i]->keep) { + _inventory[i] = NULL; + } else { + if (i != keepslot) { + _inventory[keepslot] = _inventory[i]; + _inventory[i] = NULL; + } + keepslot++; + } + } + _numInventory = keepslot; +} } // End of Namespace diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 89491b6e7b..8e6a7ab8d7 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -636,6 +636,7 @@ public: // Inventory Functions bool addToInventory(AIEntity *e); + void clearInventory(); // Cinematic Variables Common::Array<CineCommand *> _cine; |