[Scummvm-git-logs] scummvm master -> 79257bb0ed235ac456600335eefbd26284a8e37f

dreammaster paulfgilbert at gmail.com
Sun Jun 28 03:07:28 UTC 2020


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:
79257bb0ed VOYEUR: Fix changing keypad password


Commit: 79257bb0ed235ac456600335eefbd26284a8e37f
    https://github.com/scummvm/scummvm/commit/79257bb0ed235ac456600335eefbd26284a8e37f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-06-27T20:07:20-07:00

Commit Message:
VOYEUR: Fix changing keypad password

Changed paths:
    engines/voyeur/voyeur.cpp


diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index a88fd0b38a..0219488b62 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -244,7 +244,7 @@ void VoyeurEngine::showConversionScreen() {
 }
 
 bool VoyeurEngine::doLock() {
-	bool result = true;
+	bool result = true, setPassword = false;
 	int buttonVocSize, wrongVocSize;
 	byte *buttonVoc = _filesManager->fload("button.voc", &buttonVocSize);
 	byte *wrongVoc = _filesManager->fload("wrong.voc", &wrongVocSize);
@@ -351,18 +351,24 @@ bool VoyeurEngine::doLock() {
 				}
 			} else if (key == 10) {
 				// Accept key
-				if ((password.empty() && displayString.empty()) || (password == displayString)) {
+				if (setPassword) {
+					// Set a new password
+					password = displayString;
+					ConfMan.setAndFlush("lockCode", password);
+				}
+
+				if (password == displayString) {
 					breakFlag = true;
 					result = true;
 					break;
 				}
 			} else if (key == 11) {
 				// New code
-				if ((password.empty() && displayString.empty()) || (password != displayString)) {
+				if (password == displayString) {
 					_screen->_vPort->setupViewPort();
 					password = displayString;
-					ConfMan.setAndFlush("lockCode", password);
 					displayString = "";
+					setPassword = true;
 					continue;
 				}
 			} else if (key == 12) {
@@ -374,6 +380,8 @@ bool VoyeurEngine::doLock() {
 				continue;
 			}
 
+			_screen->_vPort->setupViewPort();
+			displayString = "";
 			_soundManager->playVOCMap(wrongVoc, wrongVocSize);
 		}
 




More information about the Scummvm-git-logs mailing list