diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/teenagent/inventory.cpp | 5 | ||||
-rw-r--r-- | engines/teenagent/inventory.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 3e04dcdd7e..b0fe6a009a 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -56,12 +56,13 @@ void Inventory::init(TeenAgentEngine *engine) { byte offsets = items[0]; assert(offsets == 92); - for (byte i = 0; i <= offsets; ++i) { + for (byte i = 0; i < offsets; ++i) { offset[i] = READ_LE_UINT16(items + i * 2 + 1); } + offset[92] = items_size; Resources *res = Resources::instance(); - for (byte i = 0; i <= 92; ++i) { + for (byte i = 0; i < 92; ++i) { InventoryObject io; uint16 obj_addr = res->dseg.get_word(0xc4a4 + i * 2); if (obj_addr != 0) diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index 8b302055b8..bce27c0cce 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -59,7 +59,7 @@ private: TeenAgentEngine *_engine; Surface background; byte *items; - uint16 offset[93]; + uint offset[93]; Common::Array<InventoryObject> objects; byte *inventory; |