mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 23:43:10 +00:00
MOHAWK: Update the card and stack variables when entering new locations
This commit is contained in:
parent
05bed84a85
commit
9926475937
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ public:
|
||||
private:
|
||||
void loadResourceNames();
|
||||
void loadCardIdMap();
|
||||
void setCurrentStackVariable();
|
||||
|
||||
MohawkEngine_Riven *_vm;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user