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

dwatteau noreply at scummvm.org
Sat Jul 4 21:15:07 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:
cb47285a68 SCUMM: SAMNMAX: Let one restore some unused answering machine line (floppy)


Commit: cb47285a68352494e6a3d0a95d8e1ffdb8d50266
    https://github.com/scummvm/scummvm/commit/cb47285a68352494e6a3d0a95d8e1ffdb8d50266
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2026-07-04T23:11:44+02:00

Commit Message:
SCUMM: SAMNMAX: Let one restore some unused answering machine line (floppy)

In Sam & Max's office, script 7-205 controls the random messages of the
answering machine.  As documented on the TCRF wiki, one message remains
unused.

I *think* this line was cut on purpose (the talkie release has no voice
content for it, and Sam & Max don't have any reaction to it), but one
could argue that, on the floppy release (which is only voiced during the
intro), restoring this line doesn't seem out of place, then.

So, let users decide if they wish to restore it, through the Enhancement
setting for it.  But only do so for the floppy release, where nobody
would complain about the missing audio for it.

Reported in Trac#15036.

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 5078badd556..3dddce8242b 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1702,7 +1702,11 @@ void ScummEngine_v6::o6_loadRoomWithEgo() {
 
 void ScummEngine_v6::o6_getRandomNumber() {
 	int rnd = _rnd.getRandomNumber(0x7fff);
-	rnd = rnd % (pop() + 1);
+	int max = pop();
+
+	o6_getRandomNumberApplyEnhancements(max);
+
+	rnd = rnd % (max + 1);
 	if (VAR_RANDOM_NR != 0xFF)
 		VAR(VAR_RANDOM_NR) = rnd;
 	push(rnd);
@@ -3764,4 +3768,22 @@ 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 (see Trac#15036), 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 random answering machine message, give a chance
+		// for the 5th one to be be chosen 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 6a667885795..f61cec07ea5 100644
--- a/engines/scumm/scumm_v6.h
+++ b/engines/scumm/scumm_v6.h
@@ -492,7 +492,9 @@ protected:
 	void o6_setBoxSet();
 	void o6_shuffle();
 
+	/* 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