aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/missiveomat.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-12-31 02:55:10 -0500
committerPaul Gilbert2016-12-31 02:55:10 -0500
commitfffcc7b8dd51fbd781f09dba6feaa1ed7d9f9364 (patch)
tree67976f39753e2d98cc90e6aea282af5a11bcd0bd /engines/titanic/game/missiveomat.cpp
parentdd5ffe04fad264e233030e1727faab1c6ca176ae (diff)
downloadscummvm-rg350-fffcc7b8dd51fbd781f09dba6feaa1ed7d9f9364.tar.gz
scummvm-rg350-fffcc7b8dd51fbd781f09dba6feaa1ed7d9f9364.tar.bz2
scummvm-rg350-fffcc7b8dd51fbd781f09dba6feaa1ed7d9f9364.zip
TITANIC: Fix getting entered password in MissiveOMat
Diffstat (limited to 'engines/titanic/game/missiveomat.cpp')
-rw-r--r--engines/titanic/game/missiveomat.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/titanic/game/missiveomat.cpp b/engines/titanic/game/missiveomat.cpp
index c77e298969..b11e602f27 100644
--- a/engines/titanic/game/missiveomat.cpp
+++ b/engines/titanic/game/missiveomat.cpp
@@ -97,12 +97,13 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
editMsg.execute(loginControl);
if (editMsg._param == 1000) {
+ // Get the username
editMsg._mode = 3;
editMsg.execute(loginControl);
-
_username = editMsg._text;
_username.toLowercase();
+ // Next ask for the password
if (!_username.empty()) {
loadFrame(2);
_mode = MMODE_PASSWORD;
@@ -126,9 +127,13 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
editMsg.execute(loginControl);
if (editMsg._param == 1000) {
+ // Get the password
+ editMsg._mode = 3;
+ editMsg.execute(loginControl);
_password = editMsg._text;
_password.toLowercase();
+ // Handle special variations of the names
if (_username == "droot scraliontis") {
_username = "scraliontis";
} else if (_username == "antar brobostigon") {
@@ -137,6 +142,7 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
_username = "leovinus";
}
+ // Check whether a valid username and password has been entered
bool validFlag = false;
if (_username == "leovinus" && _password == "other") {
validFlag = true;
@@ -150,6 +156,7 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
}
if (validFlag) {
+ // Credentials were valid, so log in
_mode = MMODE_LOGGED_IN;
loadFrame(4);
editMsg._mode = 1;
@@ -171,6 +178,7 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
editMsg.execute(welcome);
editMsg.execute(scrollUp);
} else {
+ // Credentials were invalid, so access denied
_mode = MMODE_DENIED;
loadFrame(3);
addTimer(1500);