[Scummvm-git-logs] scummvm master -> 853c0a989417f547738529218d572fc74e433959

dwatteau noreply at scummvm.org
Sun Aug 11 09:40:29 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
853c0a9894 SCUMM: Improve Trac#1675 and Trac#2715 bugfixes for German Indy3


Commit: 853c0a989417f547738529218d572fc74e433959
    https://github.com/scummvm/scummvm/commit/853c0a989417f547738529218d572fc74e433959
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2024-08-11T11:40:25+02:00

Commit Message:
SCUMM: Improve Trac#1675 and Trac#2715 bugfixes for German Indy3

- Fix an off-by-one in resStrLen() return value, and apply its workaround
  for Trac#2715 too.
- Merge the two convertMessageToString() workarounds into a single one,
  and fix another off-by-one in the Trac#1675 case.
- Restrict both workarounds to the German release of Indy3 (DOS release
  checked against my own copy, Amiga release tested by gabberhead).
- Restrict both workarounds to the two rooms using the wrong byte for the
  German Eszett character -- but don't limit it to a particular script
  number, because the faulty lines can be triggered by some global scripts
  too (e.g. highlighting a dialogue option).

This should fix the following problems:

- the use-case in Trac#2715 still triggering a fatal "string escape
  sequence 32 unknown" error in convertMessagetoString(), when one
  highlights the "Woher weiß ich, daß SIE kein Spion sind?" line.
- the missing full stop at the end of the "…irgendwo hier im
  Schloß." line from the drunk guard.

Changed paths:
    engines/scumm/script.cpp
    engines/scumm/string.cpp


diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 7671e8f306c..f22dbc7151a 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -1514,9 +1514,14 @@ int ScummEngine::resStrLen(const byte *src) {
 			chr = *src++;
 			num++;
 
-			// WORKAROUND for bug #1675, a script bug in Indy3. See also
-			// the corresponding code in ScummEngine::convertMessageToString().
-			if (_game.id == GID_INDY3 && chr == 0x2E) {
+			// WORKAROUND for bugs #1675 and #2715, script bugs in German Indy3.
+			// For more information, See the the corresponding workaround in
+			// ScummEngine::convertMessageToString().
+			if (_game.id == GID_INDY3 && _language == Common::DE_DEU &&
+			    ((_roomResource == 23 && chr == 0x2E) ||
+			     (_roomResource == 21 && chr == 0x20))) {
+				num--;
+				src--;
 				continue;
 			}
 
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 1a6fb5dfc87..6951d0a720b 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -1436,19 +1436,16 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
 		if (chr == 0xFF) {
 			chr = src[num++];
 
-			// WORKAROUND for bug #1675, a script bug in Indy3. Apparently,
-			// a german 'sz' was encoded incorrectly as 0xFF2E. We replace
-			// this by the correct encoding here. See also ScummEngine::resStrLen().
-			if (_game.id == GID_INDY3 && chr == 0x2E) {
-				*dst++ = 0xE1;
-				continue;
-			}
-
-			// WORKAROUND for bug #2715: Yet another script bug in Indy3.
-			// Once more a german 'sz' was encoded incorrectly, but this time
-			// they simply encoded it as 0xFF instead of 0xE1. Happens twice
-			// in script 71.
-			if (_game.id == GID_INDY3 && chr == 0x20 && vm.slot[_currentScript].number == 71) {
+			// WORKAROUND for bugs #1675 and #2715, script bugs in German Indy3.
+			// Some German 'sz' (Eszett) characters were encoded incorrectly as
+			// 0xFF instead of 0xE1, triggering convertMessageToString() and then
+			// causing a fatal error there. We replace this by the correct encoding
+			// here. At least the DOS and Amiga German releases are affected.
+			//
+			// See also ScummEngine::resStrLen().
+			if (_game.id == GID_INDY3 && _language == Common::DE_DEU &&
+				((_roomResource == 23 && chr == 0x2E) ||
+				 (_roomResource == 21 && chr == 0x20))) {
 				num--;
 				*dst++ = 0xE1;
 				continue;




More information about the Scummvm-git-logs mailing list