diff options
author | Bastien Bouclet | 2016-08-07 11:39:12 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-03 08:50:10 +0200 |
commit | 9926475937ee5ed6137f747016a72a400e69d48b (patch) | |
tree | 5858ef10415b1e2434d6d3555c17011c74da6837 | |
parent | 05bed84a859589466e12c0a62311ce6959380d2b (diff) | |
download | scummvm-rg350-9926475937ee5ed6137f747016a72a400e69d48b.tar.gz scummvm-rg350-9926475937ee5ed6137f747016a72a400e69d48b.tar.bz2 scummvm-rg350-9926475937ee5ed6137f747016a72a400e69d48b.zip |
MOHAWK: Update the card and stack variables when entering new locations
-rw-r--r-- | engines/mohawk/riven_card.cpp | 5 | ||||
-rw-r--r-- | engines/mohawk/riven_card.h | 1 | ||||
-rw-r--r-- | engines/mohawk/riven_saveload.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/riven_stack.cpp | 5 | ||||
-rw-r--r-- | engines/mohawk/riven_stack.h | 1 |
5 files changed, 12 insertions, 4 deletions
diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp index 1395100294..d064a1709a 100644 --- a/engines/mohawk/riven_card.cpp +++ b/engines/mohawk/riven_card.cpp @@ -42,6 +42,7 @@ RivenCard::RivenCard(MohawkEngine_Riven *vm, uint16 id) : loadCardSoundList(id); loadCardHotspotEnableList(id); loadCardWaterEffectList(id); + setCurrentCardVariable(); } RivenCard::~RivenCard() { @@ -432,6 +433,10 @@ void RivenCard::runLeaveScripts() { _vm->_scriptMan->runScript(script, false); } +void RivenCard::setCurrentCardVariable() { + _vm->_vars["currentcardid"] = _id; +} + RivenHotspot::RivenHotspot(MohawkEngine_Riven *vm, Common::ReadStream *stream) : _vm(vm) { loadFromStream(stream); diff --git a/engines/mohawk/riven_card.h b/engines/mohawk/riven_card.h index f387201ad4..86cfae0a85 100644 --- a/engines/mohawk/riven_card.h +++ b/engines/mohawk/riven_card.h @@ -124,6 +124,7 @@ private: void loadCardSoundList(uint16 id); void loadCardHotspotEnableList(uint16 id); void loadCardWaterEffectList(uint16 id); + void setCurrentCardVariable(); RivenScriptPtr getScript(uint16 scriptType) const; void defaultLoadScript(); diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index 37b5b6893b..0d701239c7 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -403,10 +403,6 @@ Common::Error RivenSaveLoad::saveGame(const int slot, const Common::String &desc Common::String filename = buildSaveFilename(slot); - // Convert class variables to variable numbers - _vm->_vars["currentstackid"] = _vm->getStack()->getId(); - _vm->_vars["currentcardid"] = _vm->getCard()->getId(); - Common::OutSaveFile *saveFile = _saveFileMan->openForSaving(filename); if (!saveFile) return Common::kWritingFailed; diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp index b3dc6935d9..bbe00fcf7d 100644 --- a/engines/mohawk/riven_stack.cpp +++ b/engines/mohawk/riven_stack.cpp @@ -33,6 +33,7 @@ RivenStack::RivenStack(MohawkEngine_Riven *vm, uint16 id) : _id(id) { loadResourceNames(); loadCardIdMap(); + setCurrentStackVariable(); } RivenStack::~RivenStack() { @@ -116,6 +117,10 @@ uint32 RivenStack::getCurrentCardGlobalId() const { return _cardIdMap[_vm->getCard()->getId()]; } +void RivenStack::setCurrentStackVariable() { + _vm->_vars["currentstackid"] = _id; +} + RivenNameList::RivenNameList() { } diff --git a/engines/mohawk/riven_stack.h b/engines/mohawk/riven_stack.h index 02fb58cff2..6daf3654e1 100644 --- a/engines/mohawk/riven_stack.h +++ b/engines/mohawk/riven_stack.h @@ -98,6 +98,7 @@ public: private: void loadResourceNames(); void loadCardIdMap(); + void setCurrentStackVariable(); MohawkEngine_Riven *_vm; |