[Scummvm-git-logs] scummvm master -> 2c1d8ae13f872493e47b20805417ddddfe2b2732

dwatteau noreply at scummvm.org
Wed Sep 14 21:54:34 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:
2c1d8ae13f SCUMM: Simplify the shepherd workaround for Loom


Commit: 2c1d8ae13f872493e47b20805417ddddfe2b2732
    https://github.com/scummvm/scummvm/commit/2c1d8ae13f872493e47b20805417ddddfe2b2732
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-09-14T23:51:36+02:00

Commit Message:
SCUMM: Simplify the shepherd workaround for Loom

ScummEngine::actorTalk() doesn't crash anymore when the actor number
is 0. ScummVM behaves like the original nowadays, in that the invalid
line is just silently skipped, and so restoring the missing line is
just simpler than I thought during my previous change.

We still have to deal with actor 3 which is in a buggy status in some
releases, but again it was possible to deal with this in a simpler way
(especially since my usage of `return;` was wrong, here).

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 4342541e48c..8243c2d0db9 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2730,51 +2730,24 @@ 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"...).
-	// The original interpreter would just skip the line.
-	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;
-		}
+	// WORKAROUND: in Loom v3, if one uses the stealth draft on the
+	// shepherds, their first reaction line ("We are the masters of
+	// stealth") is missing a Local[0] value for the actor number. This
+	// causes the line to be silently skipped (as in the original).
+	if (_game.id == GID_LOOM && _game.version == 3 && _roomResource == 23 && script == 232 && data[0] == 0 &&
+		vm.slot[_currentScript].number >= 422 && vm.slot[_currentScript].number <= 425 && _enableEnhancements) {
+		// Restore the missing line by attaching it to the shepherd on which the
+		// draft was used.
+		data[0] = vm.slot[_currentScript].number % 10;
+
+		// 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), so no line can be attached to him. Forcing his
+		// appearance or ignoring his removal doesn't fix this problem, for some
+		// reason.  So, if we detect this, we default to actor 4 (since that's
+		// what the Talkie version always used), for now.
+		if (data[0] == 3 && isValidActor(3) && !_actors[3]->isInCurrentRoom())
+			data[0] = 4;
 	}
 
 	// Method used by original games to skip copy protection scheme




More information about the Scummvm-git-logs mailing list