aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2018-01-10 21:37:01 +0000
committerThierry Crozat2018-01-23 02:15:47 +0000
commit963ad97e2a5d7b1dc27bd7c08e5dffbe988d45fb (patch)
tree20b1d064f01122ce34cd9de4757c7de09827348b
parente1959627639a4cfb50473c892a50d05598d44178 (diff)
downloadscummvm-rg350-963ad97e2a5d7b1dc27bd7c08e5dffbe988d45fb.tar.gz
scummvm-rg350-963ad97e2a5d7b1dc27bd7c08e5dffbe988d45fb.tar.bz2
scummvm-rg350-963ad97e2a5d7b1dc27bd7c08e5dffbe988d45fb.zip
SUPERNOVA: Fix missing reset of object CARRIED flag when clearing inventory
-rw-r--r--engines/supernova/rooms.cpp9
-rw-r--r--engines/supernova/state.cpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp
index 480f74353d..71e7010153 100644
--- a/engines/supernova/rooms.cpp
+++ b/engines/supernova/rooms.cpp
@@ -2329,13 +2329,16 @@ bool ArsanoMeetup3::interact(Action verb, Object &obj1, Object &obj2) {
_gm->reply(kStringArsanoMeetup3_28, 1, 1 + 128);
_vm->paletteFadeOut();
// Remove all objects from the inventory except the Knife, Watch and Discman
+ bool has_knife = _gm->_rooms[INTRO]->getObject(1)->hasProperty(CARRIED);
+ bool has_watch = _gm->_rooms[INTRO]->getObject(2)->hasProperty(CARRIED);
+ bool has_discman = _gm->_rooms[INTRO]->getObject(3)->hasProperty(CARRIED);
_gm->_inventory.clear();
_gm->_inventoryScroll = 0;
- if (_gm->_rooms[INTRO]->getObject(1)->hasProperty(CARRIED)) // Knife
+ if (has_knife)
_gm->_inventory.add(*_gm->_rooms[INTRO]->getObject(1));
- if (_gm->_rooms[INTRO]->getObject(2)->hasProperty(CARRIED)) // Watch
+ if (has_watch)
_gm->_inventory.add(*_gm->_rooms[INTRO]->getObject(2));
- if (_gm->_rooms[INTRO]->getObject(3)->hasProperty(CARRIED)) // Discman
+ if (has_discman)
_gm->_inventory.add(*_gm->_rooms[INTRO]->getObject(3));
_gm->changeRoom(CELL);
_gm->_state._dream = true;
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 50a7fd2223..a0776b3382 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -184,6 +184,8 @@ void Inventory::remove(Object &obj) {
}
void Inventory::clear() {
+ for (int i = 0; i < _numObjects; ++i)
+ _inventory[i]->disableProperty(CARRIED);
_numObjects = 0;
_inventoryScroll = 0;
}