[Scummvm-git-logs] scummvm master -> dd5cef0c0f9072ecfd0a3686e7a577be32a9f121

dwatteau noreply at scummvm.org
Sat Jul 4 22:27:15 UTC 2026


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

Summary:
dd5cef0c0f SCUMM: SAMNMAX: Undo previous new Enhancement


Commit: dd5cef0c0f9072ecfd0a3686e7a577be32a9f121
    https://github.com/scummvm/scummvm/commit/dd5cef0c0f9072ecfd0a3686e7a577be32a9f121
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-07-05T00:26:11+02:00

Commit Message:
SCUMM: SAMNMAX: Undo previous new Enhancement

Actually, it looks like the script "error" only exists in the talkie
releases (where the impacted line is also not voiced at all), while the
script from the floppy release already had the proper max value set for
getRandomNumber().

So this means that 1) the previous Enhancement had no real effect, as the
floppy release already displayed this line by default (at least the French
floppy one did), and 2) if LucasArts chose to *both* change the max value
of the getRandomNumber() call *and* not to voice it, then cutting it seems
more and more intentional.

And, unless one can prove that the removal was unintended, we currently
don't want to include changes clearly going *against* original intent.

This reverts most of commit cb47285a68352494e6a3d0a95d8e1ffdb8d50266 and
commit ef23da0b63f6c39a1582c9b84958c1523f9bad51.

Changed paths:
    engines/scumm/script_v6.cpp
    engines/scumm/scumm_v6.h


diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 0ca562e378f..63cec73766c 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1703,10 +1703,7 @@ void ScummEngine_v6::o6_loadRoomWithEgo() {
 void ScummEngine_v6::o6_getRandomNumber() {
 	int rnd = _rnd.getRandomNumber(0x7fff);
 	int max = pop();
-
-	o6_getRandomNumberApplyEnhancements(max);
-
-	rnd = rnd % (max + 1);
+	rnd = rnd % (pop() + 1);
 	if (VAR_RANDOM_NR != 0xFF)
 		VAR(VAR_RANDOM_NR) = rnd;
 	push(rnd);
@@ -3768,22 +3765,4 @@ void ScummEngine_v6::o6_animateActorApplyEnhancements(int &act, int &anim) {
 	}
 }
 
-void ScummEngine_v6::o6_getRandomNumberApplyEnhancements(int &randMaxVal) {
-	// WORKAROUND bug #15036: In Sam & Max, an additionnal message exists for the
-	// answering machine in the office, but script 7-205 never triggers it.  It's
-	// not voiced in the talkie release, so it may have been intentionnaly left
-	// out.  It's not going to feel out of place when playing the floppy release,
-	// though, since nothing but the intro is voiced, there; so give users the
-	// choice to restore it for this particular release.
-	if (enhancementEnabled(kEnhRestoredContent) && _game.id == GID_SAMNMAX &&
-		_currentRoom == 7 && currentScriptSlotIs(205) &&
-		strcmp(_game.variant, "Floppy") == 0) {
-		const bool answeringMachineHasNewMsg = (readVar(230) != 0);
-		// When choosing a message for the answering machine, let the
-		// "Snork!" one appear as well.
-		if (answeringMachineHasNewMsg && randMaxVal == 4)
-			randMaxVal++;
-	}
-}
-
 } // End of namespace Scumm
diff --git a/engines/scumm/scumm_v6.h b/engines/scumm/scumm_v6.h
index f61cec07ea5..24677f5e0df 100644
--- a/engines/scumm/scumm_v6.h
+++ b/engines/scumm/scumm_v6.h
@@ -494,7 +494,6 @@ protected:
 
 	/* V6 Enhancements */
 	void o6_animateActorApplyEnhancements(int &act, int &anim);
-	void o6_getRandomNumberApplyEnhancements(int &randMaxVal);
 
 	byte VAR_VIDEONAME;
 	byte VAR_RANDOM_NR;




More information about the Scummvm-git-logs mailing list