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/neverhood/modules/module1000.cpp') 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 From 9f4c221a2222d33323549b137767c0bbd68df29d Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 4 May 2014 22:23:14 +0200 Subject: NEVERHOOD: Fixed off-by-one error in getTextIndex3() This is the same fix that was applied to getKloggsTextIndex() some time ago. It restores a missing Willie nonsense letter. While I haven't actually verified for myself that this letter appears in the original game, it is referenced in Wikipedia's article about Absalom. --- engines/neverhood/modules/module1000.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/neverhood/modules/module1000.cpp') diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp index be57502d08..5e4d67d2bc 100644 --- a/engines/neverhood/modules/module1000.cpp +++ b/engines/neverhood/modules/module1000.cpp @@ -701,7 +701,7 @@ uint32 Scene1005::getKloggsTextIndex() { uint32 Scene1005::getTextIndex3() { uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX2); - if (textIndex + 1 >= 10) { + if (textIndex + 1 > 10) { textIndex = 0; } setGlobalVar(V_TEXT_COUNTING_INDEX2, textIndex + 1); -- cgit v1.2.3