From cfa0c839c33698a18e50ee8a3d126cc8ed7f589d Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 4 May 2014 22:16:46 +0200 Subject: NEVERHOOD: Fixed one of the issues in #6513 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. --- engines/neverhood/modules/module1000.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp index b19ba05b32..be57502d08 100644 --- a/engines/neverhood/modules/module1000.cpp +++ b/engines/neverhood/modules/module1000.cpp @@ -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; } -- cgit v1.2.3