[Scummvm-git-logs] scummvm master -> f05690db2a0bbb5968331d02b69a12290f311e7a

dreammaster dreammaster at scummvm.org
Sun Oct 8 16:39:26 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f05690db2a TITANIC: DE: Further tweak code wheel loading


Commit: f05690db2a0bbb5968331d02b69a12290f311e7a
    https://github.com/scummvm/scummvm/commit/f05690db2a0bbb5968331d02b69a12290f311e7a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-10-08T10:39:13-04:00

Commit Message:
TITANIC: DE: Further tweak code wheel loading

Changed paths:
    engines/titanic/game/code_wheel.cpp


diff --git a/engines/titanic/game/code_wheel.cpp b/engines/titanic/game/code_wheel.cpp
index d52f810..213dda2 100644
--- a/engines/titanic/game/code_wheel.cpp
+++ b/engines/titanic/game/code_wheel.cpp
@@ -86,6 +86,7 @@ void CodeWheel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_correctValue, indent);
 	file->writeNumberLine(_value, indent);
 	file->writeNumberLine(_matched, indent);
+
 	if (g_language == Common::DE_DEU) {
 		file->writeNumberLine(_row, indent);
 		file->writeNumberLine(_column, indent);
@@ -99,13 +100,14 @@ void CodeWheel::load(SimpleFile *file) {
 	_correctValue = file->readNumber();
 	_value = file->readNumber();
 	_matched = file->readNumber();
+
 	if (g_language == Common::DE_DEU) {
 		_row = file->readNumber();
 		_column = file->readNumber();
 
-		assert(_value >= 0 && _value < 8);
-		assert(_row >= 0 && _row < 3);
-		_correctValue = CORRECT_VALUES_DE[_row][_column];
+		assert(_column >= 1 && _column <= 8);
+		assert(_row >= 0 && _row <= 2);
+		_correctValue = CORRECT_VALUES_DE[_row][_column - 1];
 	}
 
 	CBomb::load(file);
@@ -115,11 +117,9 @@ bool CodeWheel::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	int yp = _bounds.top + _bounds.height() / 2;
 	_matched = false;
 
-	if (_value == _correctValue)
-		_matched = true;
-
 	if (msg->_mousePos.y > yp) {
 		_value = (_value + 1) % TRANSLATE(15, 27);
+
 		playMovie(TRANSLATE(START_FRAMES_EN[_value], START_FRAMES_DE[_value]),
 			TRANSLATE(END_FRAMES_EN[_value], END_FRAMES_DE[_value]),
 			MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
@@ -132,6 +132,9 @@ bool CodeWheel::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 		_value = (_value <= 0) ? TRANSLATE(14, 26) : _value - 1;
 	}
 
+	if (_value == _correctValue)
+		_matched = true;
+
 	playSound(TRANSLATE("z#59.wav", "z#590.wav"));
 	return true;
 }





More information about the Scummvm-git-logs mailing list