mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 07:23:05 +00:00
HDB: Add clearInventory()
This commit is contained in:
parent
15c2a946d1
commit
5c2cfac209
@ -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
|
||||
|
@ -636,6 +636,7 @@ public:
|
||||
|
||||
// Inventory Functions
|
||||
bool addToInventory(AIEntity *e);
|
||||
void clearInventory();
|
||||
|
||||
// Cinematic Variables
|
||||
Common::Array<CineCommand *> _cine;
|
||||
|
Loading…
x
Reference in New Issue
Block a user