diff options
author | Bastien Bouclet | 2017-07-22 16:26:16 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-07-22 20:38:56 +0200 |
commit | 7ac1bd9a57782f0488327f4b0de36d79f44aaeeb (patch) | |
tree | b1bd29052b8e635b6764c217ce04cc167c415653 /engines/mohawk | |
parent | 757459bd49d9c2aeae1b346d58c033891f668875 (diff) | |
download | scummvm-rg350-7ac1bd9a57782f0488327f4b0de36d79f44aaeeb.tar.gz scummvm-rg350-7ac1bd9a57782f0488327f4b0de36d79f44aaeeb.tar.bz2 scummvm-rg350-7ac1bd9a57782f0488327f4b0de36d79f44aaeeb.zip |
MOHAWK: Myst: Fix error when checking the rocket sliders solution twice
The game was trying to start playing the linking book video in a
blocking way whereas it was set to loop by the first check.
Fixes #9914.
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/myst_stacks/myst.cpp | 18 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/myst.h | 1 |
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 8bf759666f..37b0d4fba7 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -203,7 +203,7 @@ void Myst::setupOpcodes() { REGISTER_OPCODE(305, Myst, o_treeEntry_exit); REGISTER_OPCODE(306, Myst, o_boiler_exit); REGISTER_OPCODE(307, Myst, o_generatorControlRoom_exit); - REGISTER_OPCODE(308, Myst, NOP); + REGISTER_OPCODE(308, Myst, o_rocketSliders_exit); REGISTER_OPCODE(309, Myst, NOP); REGISTER_OPCODE(312, Myst, NOP); } @@ -2201,7 +2201,7 @@ void Myst::rocketCheckSolution() { _vm->_sound->stopEffect(); - if (solved) { + if (solved && !_rocketLinkBook) { // Reset lever position MystVideoInfo *lever = getInvokingResource<MystVideoInfo>(); lever->drawFrame(0); @@ -2341,8 +2341,8 @@ void Myst::o_rocketLeverMove(uint16 var, const ArgumentsArray &args) { // Make the lever follow the mouse int16 maxStep = lever->getStepsV() - 1; - Common::Rect rect = lever->getRect(); - int16 step = ((mouse.y - rect.top) * lever->getStepsV()) / rect.height(); + Common::Rect rect = lever->getRect(); + int16 step = ((mouse.y - rect.top) * lever->getStepsV()) / rect.height(); step = CLIP<uint16>(step, 0, maxStep); lever->drawFrame(step); @@ -3557,6 +3557,7 @@ void Myst::boilerGaugeInit() { } void Myst::o_rocketSliders_init(uint16 var, const ArgumentsArray &args) { + _rocketLinkBook.reset(); _rocketSlider1 = _vm->getViewResource<MystAreaSlider>(args[0]); _rocketSlider2 = _vm->getViewResource<MystAreaSlider>(args[1]); _rocketSlider3 = _vm->getViewResource<MystAreaSlider>(args[2]); @@ -3686,5 +3687,14 @@ void Myst::o_generatorControlRoom_exit(uint16 var, const ArgumentsArray &args) { _generatorVoltage = _state.generatorVoltage; } +void Myst::o_rocketSliders_exit(uint16 var, const ArgumentsArray &args) { + _rocketLinkBook.reset(); + _rocketSlider1 = nullptr; + _rocketSlider2 = nullptr; + _rocketSlider3 = nullptr; + _rocketSlider4 = nullptr; + _rocketSlider5 = nullptr; +} + } // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index 2da33f0389..210012616f 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -189,6 +189,7 @@ protected: DECLARE_OPCODE(o_treeEntry_exit); DECLARE_OPCODE(o_boiler_exit); DECLARE_OPCODE(o_generatorControlRoom_exit); + DECLARE_OPCODE(o_rocketSliders_exit); MystGameState::Myst &_state; |