Skip to content

Commit

Permalink
TITANIC: Fix resetting MissiveOMat after entering an invalid login
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 31, 2016
1 parent 1fb69e9 commit dd5ffe0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions engines/titanic/game/missiveomat.cpp
Expand Up @@ -88,6 +88,9 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {

switch (_mode) {
case MMODE_USERNAME:
if (!msg->_key)
return true;

playSound("z#228.wav");
editMsg._mode = 6;
editMsg._param = msg->_key;
Expand All @@ -114,6 +117,9 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
break;

case MMODE_PASSWORD:
if (!msg->_key)
return true;

playSound("z#228.wav");
editMsg._mode = 6;
editMsg._param = msg->_key;
Expand Down Expand Up @@ -144,7 +150,7 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
}

if (validFlag) {
_mode = MMODE_4;
_mode = MMODE_LOGGED_IN;
loadFrame(4);
editMsg._mode = 1;
editMsg.execute(loginControl);
Expand All @@ -165,7 +171,7 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
editMsg.execute(welcome);
editMsg.execute(scrollUp);
} else {
_mode = MMODE_3;
_mode = MMODE_DENIED;
loadFrame(3);
addTimer(1500);

Expand All @@ -185,7 +191,11 @@ bool CMissiveOMat::KeyCharMsg(CKeyCharMsg *msg) {
}

bool CMissiveOMat::TimerMsg(CTimerMsg *msg) {
if (_mode == 3) {
if (_mode == MMODE_DENIED) {
// Reset back to asking for a login username
_mode = MMODE_USERNAME;
loadFrame(1);

CTreeItem *loginControl = findRoom()->findByName("MissiveOMat Login Control");
CEditControlMsg editMsg;
editMsg._mode = 10;
Expand Down
4 changes: 2 additions & 2 deletions engines/titanic/game/missiveomat.h
Expand Up @@ -36,8 +36,8 @@ enum MissiveOMatAction {
enum MissiveOMatMode {
MMODE_USERNAME = 1,
MMODE_PASSWORD = 2,
MMODE_3 = 3,
MMODE_4 = 4,
MMODE_DENIED = 3,
MMODE_LOGGED_IN = 4,
MMODE_5 = 5
};

Expand Down

0 comments on commit dd5ffe0

Please sign in to comment.