MADS: set public 2 inventory functions, fix signed/unsigned comparison

This commit is contained in:
Strangerke 2014-03-19 08:12:11 +01:00
parent 829a099ad2
commit b04f7c1693
2 changed files with 13 additions and 12 deletions

View File

@ -110,7 +110,7 @@ void InventoryObjects::addToInventory(int objectId) {
userInterface._inventoryTopIndex = CLIP(userInterface._inventoryTopIndex,
0, (int)_inventoryList.size() - 1);
if ((userInterface._inventoryTopIndex + 5) <= (size() - 1))
if ((userInterface._inventoryTopIndex + 5) <= ((int) size() - 1))
userInterface._inventoryTopIndex = size() - 5;
userInterface._inventoryChanged = true;

View File

@ -54,17 +54,6 @@ class InventoryObjects: public Common::Array<InventoryObject> {
private:
MADSEngine *_vm;
/**
* Removes the specified object from the player's inventory
*/
void addToInventory(int objectId);
/**
* Removes the specified object to the player's inventory
* @param objectId Object to remove
* @param newScene Specifies the new scene to set the item to
*/
void removeFromInventory(int objectId, int newScene);
public:
Common::Array<int> _inventoryList;
@ -104,6 +93,18 @@ public:
* Returns true if a given object is in the player's inventory
*/
bool isInInventory(int objectId) const;
/**
* Removes the specified object from the player's inventory
*/
void addToInventory(int objectId);
/**
* Removes the specified object to the player's inventory
* @param objectId Object to remove
* @param newScene Specifies the new scene to set the item to
*/
void removeFromInventory(int objectId, int newScene);
};
} // End of namespace MADS