From 7ac1bd9a57782f0488327f4b0de36d79f44aaeeb Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 22 Jul 2017 16:26:16 +0200 Subject: 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. --- engines/mohawk/myst_stacks/myst.cpp | 18 ++++++++++++++---- engines/mohawk/myst_stacks/myst.h | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'engines/mohawk') 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(); 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(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(args[0]); _rocketSlider2 = _vm->getViewResource(args[1]); _rocketSlider3 = _vm->getViewResource(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; -- cgit v1.2.3