From be886b4e380a20aa6e3d06c98142bc4d0f604103 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 23 Jul 2013 10:44:33 +0200 Subject: [PATCH] MORTEVIELLE: Improve question cheat in debugger --- engines/mortevielle/debugger.cpp | 5 +++++ engines/mortevielle/mortevielle.h | 4 ++-- engines/mortevielle/utils.cpp | 8 +++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp index 042eb0e224e..5e1e33575f7 100644 --- a/engines/mortevielle/debugger.cpp +++ b/engines/mortevielle/debugger.cpp @@ -38,6 +38,11 @@ bool Debugger::Cmd_showAllQuestions(int argc, const char **argv) { for (int i = 1; i <= 42; ++i) _vm->_coreVar._availableQuestion[i] = '*'; + for (int i = 0; i < 9; i++) { + _vm->_nbrep[i] = 0; + _vm->_nbrepm[i] = 999; + } + return true; } diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index 04ecd56ea59..c198b246baa 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -285,8 +285,6 @@ private: byte *_cfiecBuffer; int _cfiecBufferSize; int _openObjects[8]; - int _nbrep[9]; - int _nbrepm[9]; uint16 _dialogIndexArray[kMaxDialogIndex + 1]; Hint _dialogHintArray[kMaxDialogHint + 1]; @@ -471,6 +469,8 @@ public: int _key; SaveStruct _coreVar, _saveStruct; + int _nbrep[9]; + int _nbrepm[9]; int _maff; int _caff; int _crep; diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp index c9b40c475fc..e07623bdb75 100644 --- a/engines/mortevielle/utils.cpp +++ b/engines/mortevielle/utils.cpp @@ -2300,13 +2300,11 @@ void MortevielleEngine::prepareRoom() { updateHour(day, hour, minute); if (day != _day) { _day = day; - int i = 0; - do { - ++i; - if (_nbrepm[i] != 0) + for (int i = 0; i < 9; i++) { + if (_nbrepm[i] > 0) --_nbrepm[i]; _nbrep[i] = 0; - } while (i != 8); + } } if ((hour > _hour) || ((hour == 0) && (_hour == 23))) { _hour = hour;