Skip to content

Commit

Permalink
NEVERHOOD: Fixed one of the issues in #6513
Browse files Browse the repository at this point in the history
The getKloggsTextIndex() function would return 40 twice in a row
when wrapping around. This caused one of Willie's nonsense letters
to appear instead, since they're supposed to trigger when
getTextIndex1() returns the same result more than once.

The same bug also appeared (and has been fixed) in getTextIndex3(),
but there it just caused the same nonsense letter to appear twice.
  • Loading branch information
Torbjörn Andersson committed May 4, 2014
1 parent b2be578 commit cfa0c83
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions engines/neverhood/modules/module1000.cpp
Expand Up @@ -693,22 +693,18 @@ uint32 Scene1005::getTextIndex1() {
uint32 Scene1005::getKloggsTextIndex() {
uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX1);
if (textIndex + 1 > 10) {
setGlobalVar(V_TEXT_COUNTING_INDEX1, 0);
textIndex = 0;
} else {
setGlobalVar(V_TEXT_COUNTING_INDEX1, textIndex + 1);
}
setGlobalVar(V_TEXT_COUNTING_INDEX1, textIndex + 1);
return textIndex + 40;
}

uint32 Scene1005::getTextIndex3() {
uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX2);
if (textIndex + 1 >= 10) {
setGlobalVar(V_TEXT_COUNTING_INDEX2, 0);
textIndex = 0;
} else {
setGlobalVar(V_TEXT_COUNTING_INDEX2, textIndex + 1);
}
setGlobalVar(V_TEXT_COUNTING_INDEX2, textIndex + 1);
return textIndex + 30;
}

Expand Down

0 comments on commit cfa0c83

Please sign in to comment.