aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga/interface.cpp')
-rw-r--r--engines/saga/interface.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 21e4f1227e..5153c1890e 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -317,16 +317,12 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
_inventoryStart = 0;
_inventoryEnd = 0;
_inventoryBox = 0;
- _inventorySize = ITE_INVENTORY_SIZE;
_saveReminderState = 0;
_optionSaveFileTop = 0;
_optionSaveFileTitleNumber = 0;
- _inventory = (uint16 *)calloc(_inventorySize, sizeof(uint16));
- if (_inventory == NULL) {
- error("Interface::Interface(): not enough memory");
- }
+ _inventory.resize(ITE_INVENTORY_SIZE);
_textInput = false;
_statusTextInput = false;
@@ -339,7 +335,6 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
}
Interface::~Interface() {
- free(_inventory);
}
void Interface::saveReminderCallback(void *refCon) {
@@ -2040,7 +2035,7 @@ void Interface::updateInventory(int pos) {
}
void Interface::addToInventory(int objectId) {
- if (_inventoryCount >= _inventorySize) {
+ if (uint(_inventoryCount) >= _inventory.size()) {
return;
}