[Scummvm-cvs-logs] SF.net SVN: scummvm:[48075] scummvm/trunk/engines/mohawk/riven_external.cpp
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Wed Feb 17 05:20:20 CET 2010
Revision: 48075
http://scummvm.svn.sourceforge.net/scummvm/?rev=48075&view=rev
Author: mthreepwood
Date: 2010-02-17 04:20:19 +0000 (Wed, 17 Feb 2010)
Log Message:
-----------
Cleanup handling of the telescope cover combination; matches the original algorithm much better.
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/riven_external.cpp
Modified: scummvm/trunk/engines/mohawk/riven_external.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven_external.cpp 2010-02-16 23:18:32 UTC (rev 48074)
+++ scummvm/trunk/engines/mohawk/riven_external.cpp 2010-02-17 04:20:19 UTC (rev 48075)
@@ -1251,7 +1251,7 @@
// pelevcombo keeps count of how many buttons we have pressed in the correct order.
// When pelevcombo is 5, clicking the handle will show the video freeing Catherine.
- if (argv[0] == getComboDigit(*_vm->matchVarToString("pcorrectorder"), *correctDigits))
+ if (*correctDigits < 5 && argv[0] == getComboDigit(*_vm->matchVarToString("pcorrectorder"), *correctDigits))
*correctDigits += 1;
else
*correctDigits = 0;
@@ -1397,23 +1397,20 @@
}
void RivenExternal::xtisland390_covercombo(uint16 argc, uint16 *argv) {
- // Called when clicking the telescope cover buttons. button is the button number (1...5).
- uint32 *pressedButtons = _vm->matchVarToString("tcovercombo");
+ // Called when clicking the telescope cover buttons. argv[0] is the button number (1...5).
+ uint32 *correctDigits = _vm->matchVarToString("tcovercombo");
- // We pressed a button! Yay! Add it to the queue.
- *pressedButtons *= 10;
- *pressedButtons += argv[0];
+ if (*correctDigits < 5 && argv[0] == getComboDigit(*_vm->matchVarToString("tcorrectorder"), *correctDigits))
+ *correctDigits += 1;
+ else
+ *correctDigits = 0;
- if (*pressedButtons == *_vm->matchVarToString("tcorrectorder")) {
+ // If we have hit the correct 5 buttons in a row, activate the hotspot to open up the
+ // telescope cover.
+ if (*correctDigits == 5)
_vm->_hotspots[9].enabled = true;
- } else {
+ else
_vm->_hotspots[9].enabled = false;
-
- // Set the buttons to the last one pressed if we've
- // pressed more than 5 buttons.
- if (*pressedButtons > 55555)
- *pressedButtons = argv[0];
- }
}
// Atrus' Journal and Trap Book are added to inventory
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list