SCUMM: Fix hanging Maniac Mansion cutscene with the French version (Trac#13473)

The lab cutscene where Purple Tentacle is bullying Sandy would hang
when Dr Fred is done talking, in the official French version.

This appears to be related to this VAR_CHARCOUNT check in script no. 155:

[0085] (14) print(9,"{{Dr Fred's reaction line, shorter in French}}");
[00DA] (80) breakHere();
[00DB] (44) unless (VAR_CHARCOUNT > 90) goto 00DA;

Usually, French sentences are a bit longer than English sentences, but
in this case, it's shorter, but yet the script didn't adjust the 90
value, so it would indefinitely loop, causing the scene to hang (until
the player presses the Esc key) and Sandy's reaction to be lost.

So we just pad this string with extra spaces if its length looks too
short for the default VAR_CHARCOUNT check.  This should also remain
harmless if the string *is* long enough, or if a translation did fix
the VAR_CHARCOUNT check.

Still, we only restrict this workaround to the French version for now,
since we're not aware of a similar problem with other translations.
This commit is contained in:
Donovan Watteau 2022-05-15 23:09:35 +02:00 committed by Filippos Karapetis
parent 6c6960b593
commit 77228509eb

View File

@ -396,6 +396,24 @@ void ScummEngine_v2::decodeParseString() {
}
*ptr = 0;
// WORKAROUND bug #13473: in the French version of Maniac Mansion, the cutscene
// where Purple Tentacle is bullying Sandy hangs once Dr Fred is done talking,
// because his reaction line in shorter in this translation (which is unusual for
// French which tends to be more verbose) and the `unless (VAR_CHARCOUNT > 90)`
// loop in script #155 hasn't been ajusted for this shorter length.
//
// So we add some extra spaces at the end of the string if it's too short; this
// unblocks the cutscene and also lets Sandy react as intended.
//
// (Not using `_enableEnhancements` because some users could be really confused
// by the game hanging and they may not know about the Esc key.)
if (_game.id == GID_MANIAC && _game.platform != Common::kPlatformNES && _language == Common::FR_FRA && vm.slot[_currentScript].number == 155 && _roomResource == 31 && _actorToPrintStrFor == 9) {
while (ptr - buffer < 100) {
*ptr++ = ' ';
}
*ptr = 0;
}
int textSlot = 0;
_string[textSlot].xpos = 0;
_string[textSlot].ypos = 0;