aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/inventory.cpp5
-rw-r--r--engines/fullpipe/inventory.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index c7e1fbcf70..36ee7129ab 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -96,8 +96,9 @@ bool CInventory2::loadPartial(MfcArchive &file) { // CInventory2_SerializePartia
return true;
}
-void CInventory2::addItem(int itemId, int value) {
- warning("STUB: CInventory2::addItem(%d, %d)", itemId, value);
+void CInventory2::addItem(int itemId, int count) {
+ if (getInventoryPoolItemIndexById(itemId) >= 0)
+ _inventoryItems.push_back(new InventoryItem(itemId, count));
}
void CInventory2::rebuildItemRects() {
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index f451b6a5da..0d16909f6a 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -59,6 +59,9 @@ class CInventory : public CObject {
struct InventoryItem {
int16 itemId;
int16 count;
+
+ InventoryItem() { itemId = count = 0; }
+ InventoryItem(int id, int cnt) : itemId(id), count(cnt) {}
};
typedef Common::Array<InventoryItem *> InventoryItems;
@@ -95,7 +98,7 @@ class CInventory2 : public CInventory {
public:
CInventory2();
bool loadPartial(MfcArchive &file);
- void addItem(int itemId, int value);
+ void addItem(int itemId, int count);
void rebuildItemRects();
Scene *getScene() { return _scene; }