mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
HUGO: Fix a crash in maze and a bug in lineHandler()
svn-id: r55651
This commit is contained in:
parent
5934ccd184
commit
aba8451744
@ -286,6 +286,9 @@ void Parser_v1d::dropObject(object_t *obj) {
|
||||
bool Parser_v1d::isCatchallVerb(bool testNounFl, char *noun, char *verb, objectList_t obj) {
|
||||
debugC(1, kDebugParser, "isCatchallVerb(%d, %s, %s, object_list_t obj)", (testNounFl) ? 1 : 0, noun, verb);
|
||||
|
||||
if (_maze.enabledFl)
|
||||
return false;
|
||||
|
||||
if (testNounFl && !noun)
|
||||
return false;
|
||||
|
||||
|
@ -175,6 +175,7 @@ void Parser_v1w::lineHandler() {
|
||||
return;
|
||||
if (isCatchallVerb(_vm->_backgroundObjects[*_vm->_screen_p]))
|
||||
return;
|
||||
|
||||
if (isBackgroundWord(_vm->_catchallList))
|
||||
return;
|
||||
if (isCatchallVerb(_vm->_catchallList))
|
||||
|
@ -116,8 +116,7 @@ void Parser_v2d::lineHandler() {
|
||||
if (!strcmp("exit", _vm->_line) || strstr(_vm->_line, "quit")) {
|
||||
if (Utils::Box(kBoxYesNo, "%s", _vm->_text->getTextParser(kTBExit_1d)) != 0)
|
||||
_vm->endGame();
|
||||
else
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// SAVE/RESTORE
|
||||
|
@ -118,8 +118,7 @@ void Parser_v3d::lineHandler() {
|
||||
if (!strcmp("exit", _vm->_line) || strstr(_vm->_line, "quit")) {
|
||||
if (Utils::Box(kBoxYesNo, "%s", _vm->_text->getTextParser(kTBExit_1d)) != 0)
|
||||
_vm->endGame();
|
||||
else
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// SAVE/RESTORE
|
||||
@ -179,6 +178,7 @@ void Parser_v3d::lineHandler() {
|
||||
return;
|
||||
if (isCatchallVerb(_vm->_backgroundObjects[*_vm->_screen_p]))
|
||||
return;
|
||||
|
||||
if (isBackgroundWord(_vm->_catchallList))
|
||||
return;
|
||||
if (isCatchallVerb(_vm->_catchallList))
|
||||
@ -416,6 +416,9 @@ void Parser_v3d::dropObject(object_t *obj) {
|
||||
bool Parser_v3d::isCatchallVerb(objectList_t obj) {
|
||||
debugC(1, kDebugParser, "isCatchallVerb(object_list_t obj)");
|
||||
|
||||
if (_maze.enabledFl)
|
||||
return false;
|
||||
|
||||
for (int i = 0; obj[i].verbIndex != 0; i++) {
|
||||
if (isWordPresent(_vm->_text->getVerbArray(obj[i].verbIndex)) && obj[i].nounIndex == 0 &&
|
||||
(!obj[i].matchFl || !findNoun()) &&
|
||||
@ -441,6 +444,9 @@ bool Parser_v3d::isCatchallVerb(objectList_t obj) {
|
||||
bool Parser_v3d::isBackgroundWord(objectList_t obj) {
|
||||
debugC(1, kDebugParser, "isBackgroundWord(object_list_t obj)");
|
||||
|
||||
if (_maze.enabledFl)
|
||||
return false;
|
||||
|
||||
for (int i = 0; obj[i].verbIndex != 0; i++) {
|
||||
if (isWordPresent(_vm->_text->getVerbArray(obj[i].verbIndex)) &&
|
||||
isWordPresent(_vm->_text->getNounArray(obj[i].nounIndex)) &&
|
||||
|
Loading…
Reference in New Issue
Block a user