[Scummvm-git-logs] scummvm master -> ee26cf4d18214b35fa2e1f1a18db0749d96dc4d0
bluegr
noreply at scummvm.org
Sat May 21 14:30:37 UTC 2022
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:
ee26cf4d18 SCUMM: Get the workaround for bug #1025 closer to the original behavior
Commit: ee26cf4d18214b35fa2e1f1a18db0749d96dc4d0
https://github.com/scummvm/scummvm/commit/ee26cf4d18214b35fa2e1f1a18db0749d96dc4d0
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-05-21T17:30:34+03:00
Commit Message:
SCUMM: Get the workaround for bug #1025 closer to the original behavior
In most (if not all) versions of Loom before the Talkie v4 release, one
of the shepherds should trigger a "We are the masters of stealth" line
if Bobbin tries to use the stealth draft on them, but no proper value for
the actor number is ever given. In the original interpreters, the invalid
line would be skipped. The Talkie release changes the lines a bit and
makes the third shepherd (act. 4) say something similar, instead.
Until now, ScummVM would work around this by forcing the leftmost (act. 2)
shepherd to say this line. But, looking at the original script, it seems
that the original intent may have been to let any of the four shepherds
say this line, since script 232 expects a parameter which could be given
by any of the associated 422--425 (act. 2--5) actor objects.
So, moving this check from actorTalk() to o5_startScript() lets us
implement a more comprehensive workaround (with a bit more safety checks,
since there are so many Loom versions), but it also exposes another bug
in some EGA versions and derivatives (e.g. the French EGA version has it,
but the English EGA 1.1 version doesn't): if Bobbin uses the stealth draft
on the second shepherd (act. 3), then some line(s) will be completely
missing, potentially because this actor has been removed from the scene
in the earliest versions, although he's still in use.
Having zero reaction from the shepherds when you try their draft upon
them can be extremely confusing, so we need to work around this, too.
Forcing this actor to "stay" doesn't fix the issue for now (and the
symptoms are a bit different between ScummVM and the original
interpreters), so at the moment we force this workaround even if
`_enableEnhancements` is not enabled, when we detect this strange
actor behavior.
Changed paths:
engines/scumm/actor.cpp
engines/scumm/script_v5.cpp
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 7871a31e45a..dd25aafc114 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2963,12 +2963,6 @@ void ScummEngine::actorTalk(const byte *msg) {
} else {
int oldact;
- // WORKAROUND bug #1025
- if (_game.id == GID_LOOM && _roomResource == 23 &&
- vm.slot[_currentScript].number == 232 && _actorToPrintStrFor == 0) {
- _actorToPrintStrFor = 2; // Could be anything from 2 to 5. Maybe compare to original?
- }
-
a = derefActor(_actorToPrintStrFor, "actorTalk");
if (!a->isInCurrentRoom()) {
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index a3f87e685f7..dcd0af96db1 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2470,6 +2470,52 @@ void ScummEngine_v5::o5_startScript() {
data[1] = 10;
}
+ // WORKAROUND bug #1025: in Loom, using the stealth draft on the
+ // shepherds would crash the game because of a missing actor number for
+ // their first reaction line ("We are the masters of stealth"...).
+ if (_game.id == GID_LOOM && _game.version == 3 && _roomResource == 23 && script == 232 && data[0] == 0) {
+ byte shepherdActor;
+ bool buggyShepherdsEGArelease = false;
+
+ switch (vm.slot[_currentScript].number) {
+ case 422:
+ case 423:
+ case 424:
+ case 425:
+ // It is assumed that the original intent was that any shepherd could
+ // say this line.
+ shepherdActor = vm.slot[_currentScript].number % 10;
+ break;
+ default:
+ // Match the behavior of the Talkie version, if necessary
+ shepherdActor = 4;
+ break;
+ }
+
+ // WORKAROUND: in some EGA releases, actor 3 may have been removed from the
+ // current room, although he's still on screen (the EGA English 1.1 release
+ // fixed this). In ScummVM, this invalid use means that you'd see no reaction
+ // at all from any shepherd when using the stealth draft on him. In the
+ // original interpreter, the leftmost shepherd still says his own line, though.
+ // Forcing his appearance or ignoring his removal doesn't fix this bug either.
+ //
+ // Having no reaction at all is confusing for the player, so if we detect this
+ // behavior, we force the workaround, for now.
+ if (isValidActor(3) && !_actors[3]->isInCurrentRoom()) {
+ buggyShepherdsEGArelease = true;
+ if (shepherdActor == 3)
+ shepherdActor = 4;
+ }
+
+ if (isValidActor(shepherdActor) && _actors[shepherdActor]->isInCurrentRoom() && (_enableEnhancements || buggyShepherdsEGArelease)) {
+ // Restore the missing line by attaching it to its actor
+ data[0] = shepherdActor;
+ } else {
+ // Otherwise, behave as the original, and just skip this line
+ return;
+ }
+ }
+
// Method used by original games to skip copy protection scheme
if (!_copyProtection) {
// Copy protection was disabled in LucasArts Classic Adventures (PC Disk)
More information about the Scummvm-git-logs
mailing list