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

bluegr noreply at scummvm.org
Tue Dec 1 07:38:58 UTC 2026


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

Summary:
80bcb44ad1 NANCY: NANCY18: Fix the edges of pressed buttons of the phone keypad
68e200fd80 NANCY: NANCY18: Fix the edges of the tiles of the lockpick puzzle
b0a023adbe NANCY: NANCY17: Fix sounds that kept playing after leaving an area
fc00364724 NANCY: NANCY16: Erase the subtitles of sounds once they are over
6091f3312e NANCY: NANCY17: Fix getting stuck after closing some closeups
2bf265b934 NANCY: NANCY16: Wrap the lines of scrolling text between words
d7fd959748 NANCY: NANCY17: Fix leaving the draggable pictures too early
4255b776ec NANCY: NANCY17: Fix the inventory staying open after a load
c4861753c8 NANCY: NANCY17: Play conversations on the voice channels
4cde63a7c3 NANCY: Add the stop_sound console command
74d22e629d NANCY: Take event flag labels in the event flag console commands
937ef76a61 NANCY: NANCY18: Give the UI back when a random movie goes away
f7f75a2bd2 NANCY: Describe the console commands in help
73f9513d3f NANCY: NANCY16: Squeeze the lines of scrolling text that don't fit
2dae83e603 NANCY: NANCY16: Play nothing for a sound named "silence"
027160fe8d NANCY: NANCY16: Fix debug_hotspots
497df19a43 NANCY: TVD: Fix secondary movies only drawing their upper-left quarter
de7373b390 NANCY: TVD: Fix game type assignment
e0b170cde3 NANCY: NANCY18: Fix being sent back at the start of the sentry rooms


Commit: 80bcb44ad11e77500108f4a0ffa2992d117d8154
    https://github.com/scummvm/scummvm/commit/80bcb44ad11e77500108f4a0ffa2992d117d8154
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:37+02:00

Commit Message:
NANCY: NANCY18: Fix the edges of pressed buttons of the phone keypad

>From Nancy18 on, the rects of the keypad buttons leave out their right
and bottom edges. They were read as if they included them, so a
pressed button also showed the green line that sits between the
buttons in its image, as in the phone of Nancy18 scene 3561.

Changed paths:
    engines/nancy/action/puzzle/keypadphone.cpp


diff --git a/engines/nancy/action/puzzle/keypadphone.cpp b/engines/nancy/action/puzzle/keypadphone.cpp
index 75eb003882d..8db8d9a8596 100644
--- a/engines/nancy/action/puzzle/keypadphone.cpp
+++ b/engines/nancy/action/puzzle/keypadphone.cpp
@@ -71,11 +71,18 @@ void KeypadPhone::readData(Common::SeekableReadStream &stream) {
 	readFilename(stream, _imageName);
 	_pressedTicks = (int32)(stream.readFloatLE() * kTicksPerSecond);
 
+	// Nancy18 keeps the right and bottom edges out of the buttons
+	const bool isExclusive = g_nancy->getGameType() >= kGameTypeNancy18;
 	_buttons.resize(stream.readUint16LE());
 	for (Button &button : _buttons) {
 		button.key = stream.readByte();
-		readRect(stream, button.src);
-		readRect(stream, button.dest);
+		if (isExclusive) {
+			readExclusiveRect(stream, button.src);
+			readExclusiveRect(stream, button.dest);
+		} else {
+			readRect(stream, button.src);
+			readRect(stream, button.dest);
+		}
 		button.sound.readData(stream);
 	}
 


Commit: 68e200fd80d09ff648f54d64eb82da5261cda496
    https://github.com/scummvm/scummvm/commit/68e200fd80d09ff648f54d64eb82da5261cda496
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:41+02:00

Commit Message:
NANCY: NANCY18: Fix the edges of the tiles of the lockpick puzzle

>From Nancy18 on, the rects of the tiles that the player turns leave
out their right and bottom edges. They were read as if they included
them, so each tile also showed a line of the next one in its image, as
in the lockpick of Nancy18 scene 2970.

Changed paths:
    engines/nancy/action/puzzle/tilecyclepuzzle.cpp


diff --git a/engines/nancy/action/puzzle/tilecyclepuzzle.cpp b/engines/nancy/action/puzzle/tilecyclepuzzle.cpp
index 400fa602805..e30471d41ff 100644
--- a/engines/nancy/action/puzzle/tilecyclepuzzle.cpp
+++ b/engines/nancy/action/puzzle/tilecyclepuzzle.cpp
@@ -36,6 +36,9 @@ void TileCyclePuzzle::readData(Common::SeekableReadStream &stream) {
 	_turnTime = (uint32)(stream.readDoubleLE() * 1000);
 	readFilename(stream, _imageName);
 
+	// Nancy18 keeps the right and bottom edges out of the tiles
+	const bool isExclusive = g_nancy->getGameType() >= kGameTypeNancy18;
+
 	_templates.resize(stream.readUint16LE());
 	for (Template &tileTemplate : _templates) {
 		readFilename(stream, tileTemplate.name);
@@ -44,7 +47,11 @@ void TileCyclePuzzle::readData(Common::SeekableReadStream &stream) {
 		for (Common::Array<Common::Rect> &frames : tileTemplate.states) {
 			frames.resize(stream.readUint16LE());
 			for (Common::Rect &frame : frames) {
-				readRect(stream, frame);
+				if (isExclusive) {
+					readExclusiveRect(stream, frame);
+				} else {
+					readRect(stream, frame);
+				}
 			}
 		}
 	}
@@ -71,7 +78,11 @@ void TileCyclePuzzle::readData(Common::SeekableReadStream &stream) {
 			readFilename(stream, linkedTile);
 		}
 
-		readRect(stream, tile.dest);
+		if (isExclusive) {
+			readExclusiveRect(stream, tile.dest);
+		} else {
+			readRect(stream, tile.dest);
+		}
 		tile.state = stream.readUint32LE();
 		tile.presentFlag = stream.readSint16LE();
 	}


Commit: b0a023adbe872e1cf98dee2df18f2ca828cd8ff6
    https://github.com/scummvm/scummvm/commit/b0a023adbe872e1cf98dee2df18f2ca828cd8ff6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:44+02:00

Commit Message:
NANCY: NANCY17: Fix sounds that kept playing after leaving an area

After loading a game, the streams started by the area's stream were
not tied to it anymore, so they went on after leaving the area. In
Nancy18, after loading a game saved in the Piazza San Marco, the crowd
went on talking everywhere.

The records that stop sounds or set their volume also use the channel
numbers 33 to 37 for every channel of a kind, which did nothing. The
channels now have the kinds of the original, so the voice volume of
Nancy17 and Nancy18 reaches the voices.

Changed paths:
    engines/nancy/action/soundrecords.cpp
    engines/nancy/commontypes.h
    engines/nancy/nancy.cpp
    engines/nancy/sound.cpp
    engines/nancy/state/scenestream.cpp


diff --git a/engines/nancy/action/soundrecords.cpp b/engines/nancy/action/soundrecords.cpp
index f316ad812a5..8c6df28120a 100644
--- a/engines/nancy/action/soundrecords.cpp
+++ b/engines/nancy/action/soundrecords.cpp
@@ -103,6 +103,40 @@ static Common::String resolveSoundSubtitle(const Common::String &soundName) {
 	return Common::String();
 }
 
+// From Nancy17 on, the numbers after the last channel stand for every channel of a kind
+enum SoundChannelGroup {
+	kChannelGroupAll		= 33,
+	kChannelGroupMusic		= 34,
+	kChannelGroupFX			= 35,
+	kChannelGroupAmbient	= 36,
+	kChannelGroupVoice		= 37
+};
+
+// The channels that a channel number stands for
+static void getChannels(uint16 channel, Common::Array<byte> &channels) {
+	if (g_nancy->getGameType() < kGameTypeNancy17 || channel < kChannelGroupAll || channel > kChannelGroupVoice) {
+		channels.push_back((byte)channel);
+		return;
+	}
+
+	const SoundChannelInfo &channelInfo = g_nancy->getStaticData().soundChannelInfo;
+	if (channel == kChannelGroupAll || channel == kChannelGroupMusic) {
+		channels.push_back(channelInfo.musicChannels);
+	}
+
+	if (channel == kChannelGroupAll || channel == kChannelGroupAmbient) {
+		channels.push_back(channelInfo.ambientChannels);
+	}
+
+	if (channel == kChannelGroupAll || channel == kChannelGroupFX) {
+		channels.push_back(channelInfo.sfxChannels);
+	}
+
+	if (channel == kChannelGroupAll || channel == kChannelGroupVoice) {
+		channels.push_back(channelInfo.speechChannels);
+	}
+}
+
 void SetVolume::readData(Common::SeekableReadStream &stream) {
 	channel = stream.readUint16LE();
 
@@ -114,7 +148,12 @@ void SetVolume::readData(Common::SeekableReadStream &stream) {
 }
 
 void SetVolume::execute() {
-	g_nancy->_sound->setVolume(channel, volume);
+	Common::Array<byte> channels;
+	getChannels(channel, channels);
+	for (byte id : channels) {
+		g_nancy->_sound->setVolume(id, volume);
+	}
+
 	_isDone = true;
 }
 
@@ -544,7 +583,12 @@ void StopSound::readData(Common::SeekableReadStream &stream) {
 }
 
 void StopSound::execute() {
-	g_nancy->_sound->stopSound(_channelID);
+	Common::Array<byte> channels;
+	getChannels(_channelID, channels);
+	for (byte id : channels) {
+		g_nancy->_sound->stopSound(id);
+	}
+
 	_sceneChange.execute();
 }
 
diff --git a/engines/nancy/commontypes.h b/engines/nancy/commontypes.h
index a93a94477ac..3921e6e735a 100644
--- a/engines/nancy/commontypes.h
+++ b/engines/nancy/commontypes.h
@@ -383,6 +383,7 @@ struct SoundChannelInfo {
 	Common::Array<byte> speechChannels;
 	Common::Array<byte> musicChannels;
 	Common::Array<byte> sfxChannels;
+	Common::Array<byte> ambientChannels;	// Nancy17-18: effects that scenes can stop or turn down on their own
 
 	void readData(Common::SeekableReadStream &stream);
 };
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index 04618a22591..134b5826349 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -535,6 +535,8 @@ Common::Error NancyEngine::run() {
 	if (!ConfMan.hasKey("nancy_max_saves", ConfMan.getActiveDomainName())) {
 		if (getGameType() <= kGameTypeNancy7) {
 			ConfMan.setInt("nancy_max_saves", 8, ConfMan.getActiveDomainName());
+		} else {
+			ConfMan.setInt("nancy_max_saves", 999, ConfMan.getActiveDomainName());
 		}
 	}
 
@@ -1259,16 +1261,22 @@ void NancyEngine::populateStaticData() {
 	sci.musicChannels = { 0, 1, 2, 3, 19, 26, 27, 29 };
 	sci.sfxChannels = { 4, 5, 6, 7, 8, 9, 10, 11, 17, 18, 20, 21, 22, 23, 24, 25, 31 };
 
+	if (getGameType() >= kGameTypeNancy17) {
+		// Nancy17 numbers the channels by kind: six for music, eight for ambience,
+		// ten for effects and six for voices
+		sci.musicChannels = { 0, 1, 2, 3, 4, 5 };
+		sci.ambientChannels = { 6, 7, 8, 9, 10, 11, 12, 13 };
+		sci.sfxChannels = { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
+		sci.speechChannels = { 24, 25, 26, 27, 28, 29 };
+	}
+
 	if (getGameType() >= kGameTypeNancy19) {
-		// The scripts of Nancy19 call the channels by name, and number them by
-		// kind: six for music, eight for ambience, ten for effects and six for
-		// voices. No channel belongs to a scene anymore; the scripts stop what
-		// they don't want to keep.
+		// The scripts of Nancy19 call the channels by name. No channel belongs
+		// to a scene anymore; the scripts stop what they don't want to keep.
 		sci.numChannels = 30;
 		sci.numSceneSpecificChannels = 0;
-		sci.musicChannels = { 0, 1, 2, 3, 4, 5 };
+		sci.ambientChannels.clear();
 		sci.sfxChannels = { 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
-		sci.speechChannels = { 24, 25, 26, 27, 28, 29 };
 	}
 
 	if (getGameType() >= kGameTypeNancy22) {
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 21eead0909b..6ea4dec3148 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -898,6 +898,10 @@ void SoundManager::initSoundChannels() {
 	for (const short id : channelInfo.sfxChannels) {
 		_channels[id].type = Audio::Mixer::SoundType::kSFXSoundType;
 	}
+
+	for (const short id : channelInfo.ambientChannels) {
+		_channels[id].type = Audio::Mixer::SoundType::kSFXSoundType;
+	}
 }
 
 SoundManager::Channel::~Channel() {
diff --git a/engines/nancy/state/scenestream.cpp b/engines/nancy/state/scenestream.cpp
index 7eea5fd984a..a7356ddbbf1 100644
--- a/engines/nancy/state/scenestream.cpp
+++ b/engines/nancy/state/scenestream.cpp
@@ -1004,8 +1004,19 @@ void SceneStreamManager::restore() {
 			continue;
 		}
 
-		// Loading the scene has already started some of them
-		if (find(saved.name) || saved.sceneName.empty()) {
+		// Loading the scene has already started some of them, like the stream of the
+		// environment. The streams that it started before the save still end with it.
+		SceneStream *running = find(saved.name);
+		if (running) {
+			for (const SceneStream::Child &child : saved.children) {
+				bool restartsParent = false;
+				removeChild(running->_children, child.name, restartsParent);
+				running->_children.push_back(child);
+			}
+			continue;
+		}
+
+		if (saved.sceneName.empty()) {
 			continue;
 		}
 


Commit: fc00364724f15e2055a91db64be229a1a499c57e
    https://github.com/scummvm/scummvm/commit/fc00364724f15e2055a91db64be229a1a499c57e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:49+02:00

Commit Message:
NANCY: NANCY16: Erase the subtitles of sounds once they are over

The subtitle of a sound stayed on screen after the sound ended, like
Nancy's line about the missing cards in the file cabinet of Nancy18
scene 2910. From Nancy16 on, the subtitle goes away with its sound,
unless another subtitle has replaced it.

Changed paths:
    engines/nancy/action/soundrecords.cpp


diff --git a/engines/nancy/action/soundrecords.cpp b/engines/nancy/action/soundrecords.cpp
index 8c6df28120a..6c24dc5131d 100644
--- a/engines/nancy/action/soundrecords.cpp
+++ b/engines/nancy/action/soundrecords.cpp
@@ -31,6 +31,7 @@
 #include "engines/nancy/action/soundrecords.h"
 
 #include "engines/nancy/state/scene.h"
+#include "engines/nancy/ui/ndui/manager.h"
 
 namespace Nancy {
 namespace Action {
@@ -373,6 +374,15 @@ void PlaySound::execute() {
 		break;
 	case kActionTrigger:
 		applyAfterSoundAction();
+
+		// From Nancy16 on, the caption goes away with the sound, unless another one has replaced it
+		if (g_nancy->getGameType() >= kGameTypeNancy16 && !_changeSceneImmediately && !_ccText.empty()) {
+			UI::NDUI::Manager *ndui = NancySceneState.getNDUI();
+			if (ndui && ndui->getCaption() == _ccText) {
+				ndui->setCaption(Common::String());
+			}
+		}
+
 		NancySceneState.changeScene(_sceneChange);
 
 		if (g_nancy->getGameType() <= kGameTypeNancy7) {


Commit: 6091f3312ec866a478f9d65997dfdbae7f66a1c7
    https://github.com/scummvm/scummvm/commit/6091f3312ec866a478f9d65997dfdbae7f66a1c7
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:51+02:00

Commit Message:
NANCY: NANCY17: Fix getting stuck after closing some closeups

Closing a closeup, like the paper on the cabinet door in Nancy18
scene 2996, left Nancy stuck. In Nancy17 and Nancy18, the scene that
opened such a closeup starts over when it is closed, which clears its
scene flags. The flag that asks for this was skipped, so the scene
never got to its next step. It is now read and kept in saved games.

Changed paths:
    engines/nancy/nancy.h
    engines/nancy/puzzledata.cpp
    engines/nancy/puzzledata.h
    engines/nancy/state/scenestream.cpp
    engines/nancy/state/scenestream.h


diff --git a/engines/nancy/nancy.h b/engines/nancy/nancy.h
index 616571285b1..cac71c2efd7 100644
--- a/engines/nancy/nancy.h
+++ b/engines/nancy/nancy.h
@@ -81,7 +81,9 @@ namespace Nancy {
 //       day, with the day itself stored separately
 // - 12: QuizPuzzle slots are keyed by a 32-bit id, and the Nancy15
 //       protagonists each carry their own cell phone
-static const int kSavegameVersion = 12;
+// - 13: Nancy17/18 streams keep whether ending them restarts the scene
+//       of the stream that began them
+static const int kSavegameVersion = 13;
 
 struct CVTX;
 struct ENVS;
diff --git a/engines/nancy/puzzledata.cpp b/engines/nancy/puzzledata.cpp
index 0b8d0903056..2d98f307961 100644
--- a/engines/nancy/puzzledata.cpp
+++ b/engines/nancy/puzzledata.cpp
@@ -948,7 +948,8 @@ void StreamData::synchronize(Common::Serializer &ser) {
 		for (Child &child : stream.children) {
 			ser.syncString(child.name);
 			ser.syncAsByte(child.lifetime);
-			if (g_nancy->getGameType() == kGameTypeNancyDossier2) {
+			const GameType gameType = g_nancy->getGameType();
+			if (gameType == kGameTypeNancyDossier2 || (gameType < kGameTypeNancy19 && ser.getVersion() >= 13)) {
 				ser.syncAsByte(child.restartsParent);
 			}
 		}
diff --git a/engines/nancy/puzzledata.h b/engines/nancy/puzzledata.h
index f617f669971..510cb9a71c8 100644
--- a/engines/nancy/puzzledata.h
+++ b/engines/nancy/puzzledata.h
@@ -666,7 +666,7 @@ struct StreamData : public PuzzleData {
 	struct Child {
 		Common::String name;
 		byte lifetime = 0;
-		bool restartsParent = false;	// Resorting to Danger: the parent starts its scene over when the child ends
+		bool restartsParent = false;	// the parent starts its scene over when the child ends
 	};
 
 	struct Stream {
diff --git a/engines/nancy/state/scenestream.cpp b/engines/nancy/state/scenestream.cpp
index a7356ddbbf1..b4e141d1fec 100644
--- a/engines/nancy/state/scenestream.cpp
+++ b/engines/nancy/state/scenestream.cpp
@@ -49,7 +49,7 @@ void StreamFlags::read(Common::SeekableReadStream &stream) {
 	lifetime = stream.readByte();
 	capturesInput = stream.readByte();
 	runsFirst = stream.readByte();
-	stream.skip(1);	// Unknown
+	restartsParent = stream.readByte();
 	zOffset = stream.readSint32LE();
 }
 
@@ -635,9 +635,20 @@ void SceneStreamManager::restartParentOf(const Common::String &name) {
 		}
 	}
 
-	if (restartsParent && !parentName.empty()) {
-		changeScene(parentName, getSceneName(parentName), (uint16)MAX(getSceneFrame(parentName), 0));
+	if (!restartsParent || parentName.empty()) {
+		return;
 	}
+
+	// The scenes of Nancy17 and Nancy18 go by number
+	if (g_nancy->getGameType() < kGameTypeNancy19) {
+		SceneStream *parent = find(parentName);
+		SceneChangeDescription scene = parent ? parent->getSceneInfo() : NancySceneState.getSceneInfo();
+		scene.continueSceneSound = kContinueSceneSound;
+		changeScene(parentName, scene);
+		return;
+	}
+
+	changeScene(parentName, getSceneName(parentName), (uint16)MAX(getSceneFrame(parentName), 0));
 }
 
 void SceneStreamManager::changeScene(const Common::String &name, const SceneChangeDescription &sceneDescription) {
diff --git a/engines/nancy/state/scenestream.h b/engines/nancy/state/scenestream.h
index 241c6fdfefc..0dd0128d62a 100644
--- a/engines/nancy/state/scenestream.h
+++ b/engines/nancy/state/scenestream.h
@@ -74,7 +74,7 @@ struct StreamFlags {
 	byte lifetime = kIndependent;
 	bool capturesInput = false;	// the streams after this one get no input
 	bool runsFirst = false;		// put in front of the running streams
-	bool restartsParent = false;	// Resorting to Danger: the stream that began it starts its scene over when it ends
+	bool restartsParent = false;	// the stream that began it starts its scene over when it ends
 	int32 zOffset = 0;			// added to the z order of everything the stream draws
 
 	// Nancy26


Commit: 2bf265b9343447ed5f099055acede9e2d6999f21
    https://github.com/scummvm/scummvm/commit/2bf265b9343447ed5f099055acede9e2d6999f21
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:55+02:00

Commit Message:
NANCY: NANCY16: Wrap the lines of scrolling text between words

The text on computer screens, like the trash can of Fargo's laptop in
Nancy18 scene 2936, ran off the screen in long lines. Like the
original, the lines are now wrapped to the width of their rect. Only
the spaces between words break a line, so a word that is too long
still runs past the right edge, as in Nancy17's grave quiz.

The lines are measured in the widths of Tahoma, the font the games
ask for, which is narrower than the font that stands in for it. This
keeps names like the one in Nancy17 scene 4582 on a single line.

Changed paths:
    engines/nancy/action/autotextscroll.cpp
    engines/nancy/font.cpp
    engines/nancy/font.h
    engines/nancy/misc/hypertext.cpp
    engines/nancy/misc/hypertext.h


diff --git a/engines/nancy/action/autotextscroll.cpp b/engines/nancy/action/autotextscroll.cpp
index 0c1eeb2dbf4..de024c68f44 100644
--- a/engines/nancy/action/autotextscroll.cpp
+++ b/engines/nancy/action/autotextscroll.cpp
@@ -47,14 +47,14 @@ public:
 	void render(const Common::String &text, uint width, uint fontID, uint colorID, Graphics::ManagedSurface &image);
 };
 
-// The lines of the text aren't wrapped; one that is too long goes past the right
-// of the rect, and is aligned in the rect otherwise
+// The lines are wrapped between words only; a word too long for the rect goes
+// past its right
 void AutotextScrollRenderer::render(const Common::String &text, uint width, uint fontID, uint colorID, Graphics::ManagedSurface &image) {
 	const uint surfaceWidth = MAX(width, kMaxLineWidth);
 	_fullSurface.create(surfaceWidth, kMaxTextHeight, g_nancy->_graphics->getInputPixelFormat());
 	_fullSurface.clear(g_nancy->_graphics->getTransColor());
 	_defaultTextColor = colorID;
-	_wrapsLines = false;
+	_keepsWordsWhole = true;
 
 	addTextLine(text);
 	drawAllText(Common::Rect(width, kMaxTextHeight), 0, fontID, fontID);
@@ -115,8 +115,14 @@ void AutotextScroll::startText(const Common::String &key) {
 	assert(autotext);
 
 	ScrollingText *text = new ScrollingText();
+	// The width of the data rect, which Nancy18 makes one pixel narrower
+	int width = _bounds.width() - 1;
+	if (g_nancy->getGameType() >= kGameTypeNancy18) {
+		--width;
+	}
+
 	AutotextScrollRenderer renderer;
-	renderer.render(autotext->texts[key], _bounds.width(), _fontID, _colorID, text->image);
+	renderer.render(autotext->texts[key], MAX(width, 1), _fontID, _colorID, text->image);
 	text->offset = _bounds.top - _startDepth;
 	_texts.push_back(text);
 }
diff --git a/engines/nancy/font.cpp b/engines/nancy/font.cpp
index 5dab7826bda..fc2c09de138 100644
--- a/engines/nancy/font.cpp
+++ b/engines/nancy/font.cpp
@@ -201,6 +201,7 @@ void Font::readSystemFont(Common::SeekableReadStream &stream, bool bold) {
 
 void Font::setSystemFont(const Common::String &name, const Common::String &faceName, int32 height, int32 weight, const Common::Path &fileName) {
 	_description = name;
+	_widthScale = 1.0f;
 
 #ifdef USE_FREETYPE2
 	// A font file that comes with the game takes the place of the Windows font
@@ -230,6 +231,12 @@ void Font::setSystemFont(const Common::String &name, const Common::String &faceN
 	const Common::String substitute = Common::String::format("Liberation%s-%s.ttf",
 		faceName.hasPrefixIgnoreCase("Courier") ? "Mono" : "Sans", style);
 	_systemFont.reset(Graphics::loadTTFFontFromArchive(substitute, height, Graphics::kTTFSizeModeCell), DisposeAfterUse::YES);
+
+	// Tahoma is narrower than Liberation Sans of the same height, by about 8% in
+	// regular and 2% in bold
+	if (_systemFont && faceName.hasPrefixIgnoreCase("Tahoma")) {
+		_widthScale = isBold ? 0.98f : 0.92f;
+	}
 #endif
 
 	if (!_systemFont) {
diff --git a/engines/nancy/font.h b/engines/nancy/font.h
index 626ee16eaed..b015b214fdf 100644
--- a/engines/nancy/font.h
+++ b/engines/nancy/font.h
@@ -54,6 +54,8 @@ public:
 	const Common::String &getName() const { return _description; }
 	// Nancy16+: the substitute font, for drawing with an explicit color instead of a color ID
 	const Graphics::Font *getSystemFont() const { return _systemFont.get(); }
+	// How wide the Windows font is compared to its substitute, for breaking lines where the game does
+	float getWidthScale() const { return _widthScale; }
 
 	int getFontHeight() const override { return _systemFont ? _systemFont->getFontHeight() : _fontHeight - 1; }
 
@@ -169,6 +171,7 @@ private:
 	const struct TBOX *_textboxData = nullptr;
 
 	Common::DisposablePtr<const Graphics::Font> _systemFont{nullptr, DisposeAfterUse::NO};
+	float _widthScale = 1.0f;
 
 	int _fontHeight = 0;
 	int _maxCharWidth = 0;
diff --git a/engines/nancy/misc/hypertext.cpp b/engines/nancy/misc/hypertext.cpp
index 4ff03eaf518..b27a8651819 100644
--- a/engines/nancy/misc/hypertext.cpp
+++ b/engines/nancy/misc/hypertext.cpp
@@ -101,6 +101,42 @@ static uint lineStep(const Font *font) {
 	return font->getFontHeight();
 }
 
+// Breaks the lines only between words; a word too long for the width stays whole
+// and runs past it. The lines are measured in the widths of the font the game
+// asked for, so they break where they do in the game.
+static void wrapWholeWords(const Font *font, const Common::String &text, int maxWidth, Common::Array<Common::String> &lines) {
+	Common::String line;
+	uint pos = 0;
+	while (pos < text.size()) {
+		if (text[pos] == '\n') {
+			lines.push_back(line);
+			line.clear();
+			++pos;
+			continue;
+		}
+
+		// The spaces before a word go with it
+		uint end = pos;
+		while (end < text.size() && text[end] == ' ') {
+			++end;
+		}
+		while (end < text.size() && text[end] != ' ' && text[end] != '\n') {
+			++end;
+		}
+
+		Common::String word = text.substr(pos, end - pos);
+		if (!line.empty() && font->getStringWidth(line + word) * font->getWidthScale() > maxWidth) {
+			lines.push_back(line);
+			line.clear();
+		}
+
+		line += word;
+		pos = end;
+	}
+
+	lines.push_back(line);
+}
+
 void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffsetNonNewline, uint fontID, uint highlightFontID) {
 	using namespace Common;
 
@@ -329,13 +365,18 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
 		// Do word wrapping on the text, sans tokens. This assumes
 		// all text uses fonts of the same width
 		Array<Common::String> wrappedLines;
-		int maxWidth = _wrapsLines ? textBounds.width() : _fullSurface.w;
+		int maxWidth = textBounds.width();
 		if (hasMark) {
 			auto *mark = GetEngineData(MARK);
 			assert(mark);
 			maxWidth -= mark->_markSrcs[0].width();
 		}
-		font->wordWrap(currentLine, maxWidth, wrappedLines, 0);
+
+		if (_keepsWordsWhole) {
+			wrapWholeWords(font, currentLine, maxWidth, wrappedLines);
+		} else {
+			font->wordWrap(currentLine, maxWidth, wrappedLines, 0);
+		}
 
 		// Setup most of the hotspot; textbox
 		if (hasHotspot) {
@@ -532,7 +573,7 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
 				// Draw the normal text
 				const int drawX = textBounds.left + horizontalOffset + (newLineStart ? 0 : leftOffsetNonNewline);
 				const int drawY = textBounds.top + _numDrawnLines * lineStep(font) + _imageVerticalOffset;
-				drawTextRun(_fullSurface, font, stringToDraw, drawX, drawY, _wrapsLines ? textBounds.width() : _fullSurface.w - drawX, colorID);
+				drawTextRun(_fullSurface, font, stringToDraw, drawX, drawY, _keepsWordsWhole ? _fullSurface.w - drawX : textBounds.width(), colorID);
 
 				// Underline the segment (the <u> markup toggle) in the text color.
 				if (underline && !stringToDraw.empty()) {
diff --git a/engines/nancy/misc/hypertext.h b/engines/nancy/misc/hypertext.h
index 3023d7f046e..8bfa40edb69 100644
--- a/engines/nancy/misc/hypertext.h
+++ b/engines/nancy/misc/hypertext.h
@@ -101,8 +101,9 @@ protected:
 	uint16 _lastLineStep;	// How far apart the lines of the font drawn last are
 	bool _needsTextRedraw;
 
-	// Otherwise a line is as long as its text, and may run past the right of the bounds
-	bool _wrapsLines = true;
+	// Otherwise words too long for a line get split. A whole word may run past the
+	// right of the bounds.
+	bool _keepsWordsWhole = false;
 
 private:
 	// Color IDs are font color IDs, or this for the color given to setDefaultTextRGB()


Commit: d7fd959748b1404626dcd056b426ea84e9943703
    https://github.com/scummvm/scummvm/commit/d7fd959748b1404626dcd056b426ea84e9943703
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:37:57+02:00

Commit Message:
NANCY: NANCY17: Fix leaving the draggable pictures too early

The closeup of a microdot, like in Nancy18 scene 3263, closed when the
picture was dragged from the bottom of the screen, and the microdot
was gone from the inventory afterwards. Like the original, a press on
the exit can now drag the picture, and only a click takes the exit.
The exit now happens before the records of the scene run once more,
so the one that gives the microdot back registers its flag.

Changed paths:
    engines/nancy/action/puzzle/dragsurfacepuzzle.cpp


diff --git a/engines/nancy/action/puzzle/dragsurfacepuzzle.cpp b/engines/nancy/action/puzzle/dragsurfacepuzzle.cpp
index cd921ade09d..9e46557200b 100644
--- a/engines/nancy/action/puzzle/dragsurfacepuzzle.cpp
+++ b/engines/nancy/action/puzzle/dragsurfacepuzzle.cpp
@@ -115,18 +115,15 @@ void DragSurfacePuzzle::execute() {
 		_state = kRun;
 		// fall through
 	case kRun:
-		if (_exitRequested || _zoneSceneRequested) {
+		if (_exitRequested) {
+			finishExecution();
+		} else if (_zoneSceneRequested) {
 			_state = kActionTrigger;
 		}
 
 		break;
 	case kActionTrigger:
-		if (_zoneSceneRequested) {
-			NancySceneState.changeScene(_zoneScene);
-		} else {
-			_exitScene.execute();
-		}
-
+		NancySceneState.changeScene(_zoneScene);
 		finishExecution();
 		break;
 	}
@@ -147,24 +144,13 @@ void DragSurfacePuzzle::handleInput(NancyInput &input) {
 		return;
 	}
 
-	if (!_isMouseDown && hoverExitHotspot(input)) {
-		if (isReleased) {
-			_exitRequested = true;
-			input.eatMouseInput();
-		}
-
-		return;
-	}
-
 	Common::Rect mouseRect = NancySceneState.getViewport().convertScreenToViewport(
 		Common::Rect(input.mousePos.x, input.mousePos.y, input.mousePos.x + 1, input.mousePos.y + 1));
 	Common::Point pos = mouseRect.origin();
 
-	if (!_dest.contains(pos)) {
-		return;
-	}
-
-	if (input.input & NancyInput::kLeftMouseButtonDown) {
+	// A press on the exit hotspot can still drag the picture, like the microdots in
+	// Nancy18 scenes 3263 and 3285, whose exit is along the bottom of the picture
+	if ((input.input & NancyInput::kLeftMouseButtonDown) && (_dest.contains(pos) || isExitHotspotHovered(input))) {
 		_isMouseDown = true;
 		_hasDragged = false;
 		_pressPos = pos;
@@ -193,6 +179,22 @@ void DragSurfacePuzzle::handleInput(NancyInput &input) {
 		_hasDragged = false;
 	}
 
+	if (hoverExitHotspot(input)) {
+		if (clicked) {
+			// The scene changes after the records of this frame, which can depend on the
+			// flag of the exit: the microdot scenes give the microdot back with it
+			_exitScene.execute();
+			_exitRequested = true;
+			input.eatMouseInput();
+		}
+
+		return;
+	}
+
+	if (!_dest.contains(pos)) {
+		return;
+	}
+
 	Common::Point picturePos = pos - _dest.origin() + _src.origin();
 
 	bool hasZoneCursor = false;


Commit: 4255b776ecec40a71b123422c6d32339ee3679f3
    https://github.com/scummvm/scummvm/commit/4255b776ecec40a71b123422c6d32339ee3679f3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:00+02:00

Commit Message:
NANCY: NANCY17: Fix the inventory staying open after a load

A game saved with the inventory open showed its frame twice when
loaded, and closing the inventory left an empty frame on the screen
that could not be closed. Only Nancy16 needs as many hides as shows
to take a panel away; from Nancy17 on, like in the original, a hide
always hides it.

Changed paths:
    engines/nancy/ui/ndui/panel.cpp


diff --git a/engines/nancy/ui/ndui/panel.cpp b/engines/nancy/ui/ndui/panel.cpp
index c363292bfd1..55cd97e6000 100644
--- a/engines/nancy/ui/ndui/panel.cpp
+++ b/engines/nancy/ui/ndui/panel.cpp
@@ -599,7 +599,7 @@ void Panel::finishBlending() {
 	_isDirty = true;
 }
 
-// Before Nancy19, every show needs a matching hide before the panel goes away
+// In Nancy16, every show needs a matching hide before the panel goes away
 void Panel::show() {
 	++_showCount;
 	if (_isCollapsed) {
@@ -630,10 +630,10 @@ void Panel::setCollapsed(bool isCollapsed) {
 	}
 }
 
-// Nancy19 and up don't count: a hide always hides, and tells the scripts. Nancy25
-// opens the phone without showing its panel, and closes it by hiding that.
+// Only Nancy16 counts: from Nancy17 on a hide always hides, and tells the scripts.
+// Nancy25 opens the phone without showing its panel, and closes it by hiding that.
 void Panel::hide() {
-	if (g_nancy->getGameType() < kGameTypeNancy19) {
+	if (g_nancy->getGameType() == kGameTypeNancy16) {
 		--_showCount;
 		if (_showCount < 0) {
 			_showCount = 0;


Commit: c4861753c8bb54a65ce52043bcbfb15780f60a4b
    https://github.com/scummvm/scummvm/commit/c4861753c8bb54a65ce52043bcbfb15780f60a4b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:02+02:00

Commit Message:
NANCY: NANCY17: Play conversations on the voice channels

The records that turn down the music and the other sounds during
conversations also turned down the voices, like in Nancy18 scene
1000, and Nancy's answers could hardly be heard at first. Like the
original, the line and the answer now play on the first two voice
channels.

Changed paths:
    engines/nancy/action/conversation.cpp


diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index d457bdc2042..0743bfabc98 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -43,6 +43,11 @@
 namespace Nancy {
 namespace Action {
 
+enum ConversationChannel {
+	kConversationLineChannel		= 24,
+	kConversationResponseChannel	= 25
+};
+
 ConversationSound::ConversationSound() :
 		RenderActionRecord(8),
 		_noResponse(g_nancy->getGameType() <= kGameTypeNancy2 ||
@@ -197,6 +202,13 @@ void ConversationSound::readDataNancy13(Common::SeekableReadStream &stream) {
 	_sound.channelID = 12;	// hardcoded, as in the terse variants
 	_sound.numLoops = 1;
 
+	// Nancy17 plays the line and the response on the first two voice channels, which
+	// the records that turn down the other sounds during conversations leave alone
+	if (g_nancy->getGameType() >= kGameTypeNancy17) {
+		_sound.channelID = kConversationLineChannel;
+		_responseGenericSound.channelID = kConversationResponseChannel;
+	}
+
 	// A sound name of "CONCAT" (Nancy14+) means the line is split across several
 	// sound files, which follow after their count. The original allows 5 at most.
 	if (hasSoundList || _sound.name.equalsIgnoreCase("CONCAT")) {


Commit: 4cde63a7c3ef9d811d0cd5d9826588fa0e40e276
    https://github.com/scummvm/scummvm/commit/4cde63a7c3ef9d811d0cd5d9826588fa0e40e276
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:05+02:00

Commit Message:
NANCY: Add the stop_sound console command

It stops the sounds playing on the given channels, which sound_info
lists.

Changed paths:
    engines/nancy/console.cpp
    engines/nancy/console.h


diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 06aecbedb14..7a44a12e95e 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -94,6 +94,7 @@ NancyConsole::NancyConsole() : GUI::Debugger() {
 	registerCmd("get_difficulty", WRAP_METHOD(NancyConsole, Cmd_getDifficulty));
 	registerCmd("set_difficulty", WRAP_METHOD(NancyConsole, Cmd_setDifficulty));
 	registerCmd("sound_info", WRAP_METHOD(NancyConsole, Cmd_soundInfo));
+	registerCmd("stop_sound", WRAP_METHOD(NancyConsole, Cmd_stopSound));
 	registerCmd("debug_hotspots", WRAP_METHOD(NancyConsole, Cmd_showHotspots));
 	registerCmd("ui_control", WRAP_METHOD(NancyConsole, Cmd_uiControl));
 }
@@ -1977,6 +1978,33 @@ bool NancyConsole::Cmd_soundInfo(int argc, const char **argv) {
 	return true;
 }
 
+bool NancyConsole::Cmd_stopSound(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("Stops the sounds playing on the given channels; sound_info lists them\n");
+		debugPrintf("Usage: %s <channel>...\n", argv[0]);
+		return true;
+	}
+
+	const uint numChannels = g_nancy->getStaticData().soundChannelInfo.numChannels;
+	for (int i = 1; i < argc; ++i) {
+		const uint channelID = atoi(argv[i]);
+		if (channelID >= numChannels) {
+			debugPrintf("Invalid channel %s, there are %u channels\n", argv[i], numChannels);
+			continue;
+		}
+
+		if (!g_nancy->_sound->isSoundPlaying(channelID)) {
+			debugPrintf("Nothing is playing on channel %u\n", channelID);
+			continue;
+		}
+
+		g_nancy->_sound->stopSound(channelID);
+		debugPrintf("Stopped channel %u\n", channelID);
+	}
+
+	return true;
+}
+
 bool NancyConsole::Cmd_showHotspots(int argc, const char **argv) {
 	ConfMan.setBool("debug_hotspots", !ConfMan.getBool("debug_hotspots", Common::ConfigManager::kTransientDomain), Common::ConfigManager::kTransientDomain);
 
diff --git a/engines/nancy/console.h b/engines/nancy/console.h
index 1854f198fa8..ccdea250dc2 100644
--- a/engines/nancy/console.h
+++ b/engines/nancy/console.h
@@ -81,6 +81,7 @@ private:
 	bool Cmd_getDifficulty(int argc, const char **argv);
 	bool Cmd_setDifficulty(int argc, const char **argv);
 	bool Cmd_soundInfo(int argc, const char **argv);
+	bool Cmd_stopSound(int argc, const char **argv);
 	bool Cmd_showHotspots(int argc, const char **argv);
 	bool Cmd_uiControl(int argc, const char **argv);
 


Commit: 74d22e629d474ffbdf217398845a2328cda2548e
    https://github.com/scummvm/scummvm/commit/74d22e629d474ffbdf217398845a2328cda2548e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:06+02:00

Commit Message:
NANCY: Take event flag labels in the event flag console commands

get_eventflags and set_eventflags added 1000 to the number they got,
but list the flags by label, so set_eventflags 1010 set flag 2010.
Numbers from 1000 on are now labels; smaller numbers still count from
the first flag.

Changed paths:
    engines/nancy/console.cpp


diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 7a44a12e95e..e248321aaca 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -1379,6 +1379,23 @@ bool NancyConsole::Cmd_findInclude(int argc, const char **argv) {
 	return true;
 }
 
+// Nancy3 and later number the event flags from 1000. A number below that is the
+// index of the flag, like it used to be, and any other number is its label, as
+// the flags are listed. Returns -1 for a flag that doesn't exist.
+static int parseEventFlagNumber(const char *arg) {
+	const int baseLabel = g_nancy->getGameType() >= kGameTypeNancy3 ? 1000 : 0;
+	int label = atoi(arg);
+	if (label < baseLabel) {
+		label += baseLabel;
+	}
+
+	if (label - baseLabel >= (int)g_nancy->getStaticData().numEventFlags) {
+		return -1;
+	}
+
+	return label;
+}
+
 bool NancyConsole::Cmd_getEventFlags(int argc, const char **argv) {
 	if (g_nancy->getState() != NancyState::kScene) {
 		debugPrintf("Not in the kScene state\n");
@@ -1404,8 +1421,8 @@ bool NancyConsole::Cmd_getEventFlags(int argc, const char **argv) {
 		}
 	} else {
 		for (int i = 1; i < argc; ++i) {
-			int label = baseLabel + atoi(argv[i]);
-			if (label - baseLabel < 0 || label - baseLabel >= (int)numEventFlags) {
+			int label = parseEventFlagNumber(argv[i]);
+			if (label < 0) {
 				debugPrintf("\nInvalid flag %s", argv[i]);
 				continue;
 			}
@@ -1436,10 +1453,7 @@ bool NancyConsole::Cmd_setEventFlags(int argc, const char **argv) {
 	for (int i = 1; i < argc; i += 2) {
 		int label = -1;
 		if (Common::isDigit(argv[i][0])) {
-			label = baseLabel + atoi(argv[i]);
-			if (label - baseLabel >= (int)g_nancy->getStaticData().numEventFlags) {
-				label = -1;
-			}
+			label = parseEventFlagNumber(argv[i]);
 		} else {
 			// By name. From Nancy12 on, the flags of the game are the ones of the
 			// EVNT chunk, numbered from 2000.


Commit: 937ef76a61d5af774e1f39656bf10d7e09ad2c33
    https://github.com/scummvm/scummvm/commit/937ef76a61d5af774e1f39656bf10d7e09ad2c33
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:08+02:00

Commit Message:
NANCY: NANCY18: Give the UI back when a random movie goes away

The talking animations of some conversations, like Enrico's in Nancy18
scene 1301, keep the mouse away from the UI while they play. They kept
it away after the line was over too, and the answers couldn't be
picked. A random movie that is gone because its dependencies stopped
holding now gives the mouse back to the UI.

Changed paths:
    engines/nancy/action/secondarymovie.cpp
    engines/nancy/action/secondarymovie.h


diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index 904d48e894f..13443f71535 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -58,9 +58,25 @@ PlaySecondaryMovie::~PlaySecondaryMovie() {
 		g_nancy->setMouseEnabled(true);
 	}
 
-	if (_hasLockedUIMouse && NancySceneState.getNDUI()) {
-		NancySceneState.getNDUI()->unlockMouseInput();
+	setUIMouseLocked(false);
+}
+
+// The UI panels get no mouse input while a Nancy18 random movie that asks for it is on
+// screen. One whose dependencies stopped holding is gone, and gives the UI back, like
+// the talking animations of Nancy18 scene 1301 that end with the line.
+void PlaySecondaryMovie::setUIMouseLocked(bool isLocked) {
+	UI::NDUI::Manager *ndui = NancySceneState.getNDUI();
+	if (!ndui || isLocked == _hasLockedUIMouse) {
+		return;
+	}
+
+	if (isLocked) {
+		ndui->lockMouseInput();
+	} else {
+		ndui->unlockMouseInput();
 	}
+
+	_hasLockedUIMouse = isLocked;
 }
 
 bool PlaySecondaryMovie::survivesSceneChange(bool nextSceneIsNoArt) const {
@@ -1124,6 +1140,7 @@ void PlaySecondaryMovie::updateGraphics() {
 			_isHiddenByDependencies = true;
 			_decoder.pauseVideo(true);
 			setVisible(false);
+			setUIMouseLocked(false);
 		}
 
 		return;
@@ -1258,6 +1275,7 @@ void PlaySecondaryMovie::execute() {
 		_isHiddenByDependencies = false;
 		_decoder.pauseVideo(_randomPaused);
 		setVisible(true);
+		setUIMouseLocked(_locksUIMouse);
 	}
 
 	switch (_state) {
@@ -1289,10 +1307,7 @@ void PlaySecondaryMovie::execute() {
 			g_nancy->setMouseEnabled(false);
 		}
 
-		if (_locksUIMouse && !_hasLockedUIMouse && NancySceneState.getNDUI()) {
-			NancySceneState.getNDUI()->lockMouseInput();
-			_hasLockedUIMouse = true;
-		}
+		setUIMouseLocked(_locksUIMouse);
 
 		NancySceneState.setActiveMovie(this);
 
diff --git a/engines/nancy/action/secondarymovie.h b/engines/nancy/action/secondarymovie.h
index d09495aaf57..8a78d364a0c 100644
--- a/engines/nancy/action/secondarymovie.h
+++ b/engines/nancy/action/secondarymovie.h
@@ -393,6 +393,7 @@ protected:
 	void applyVideoDesc(int descID);
 	Common::Rect getVideoDescDest(int descID) const;
 	void pickRandomPosition();
+	void setUIMouseLocked(bool isLocked);
 
 	Graphics::ManagedSurface _fullFrame;
 	Graphics::ManagedSurface _maskImage;


Commit: f7f75a2bd25d0c3654a9dd3cb165fddf9d0b0788
    https://github.com/scummvm/scummvm/commit/f7f75a2bd25d0c3654a9dd3cb165fddf9d0b0788
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:09+02:00

Commit Message:
NANCY: Describe the console commands in help

The help command of the console now lists the commands of the engine
by topic, with what each of them does

Changed paths:
    engines/nancy/console.cpp
    engines/nancy/console.h


diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index e248321aaca..f17db8b8b4d 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -54,6 +54,7 @@
 namespace Nancy {
 
 NancyConsole::NancyConsole() : GUI::Debugger() {
+	registerCmd("help", WRAP_METHOD(NancyConsole, Cmd_help));
 	registerCmd("load_cal", WRAP_METHOD(NancyConsole, Cmd_loadCal));
 	registerCmd("cif_export", WRAP_METHOD(NancyConsole, Cmd_cifExport));
 	registerCmd("ciftree_export", WRAP_METHOD(NancyConsole, Cmd_ciftreeExport));
@@ -101,6 +102,79 @@ NancyConsole::NancyConsole() : GUI::Debugger() {
 
 NancyConsole::~NancyConsole() {}
 
+bool NancyConsole::Cmd_help(int argc, const char **argv) {
+	debugPrintf("Most commands show their usage when run without arguments.\n");
+	debugPrintf("\n");
+	debugPrintf("General\n");
+	debugPrintf("-------\n");
+	debugPrintf(" exit / quit - Closes the console\n");
+	debugPrintf(" clear / cls - Clears the console\n");
+	debugPrintf(" debuglevel - Shows or sets the debug level\n");
+	debugPrintf(" debugflag_list - Lists the debug flags and whether they are on\n");
+	debugPrintf(" debugflag_enable - Turns a debug flag on\n");
+	debugPrintf(" debugflag_disable - Turns a debug flag off\n");
+	debugPrintf("\n");
+	debugPrintf("Resources\n");
+	debugPrintf("---------\n");
+	debugPrintf(" load_cal - Loads a .cal file, so its resources can be used\n");
+	debugPrintf(" cif_list - Lists the resources of a type in a ciftree\n");
+	debugPrintf(" cif_info - Shows information about a resource\n");
+	debugPrintf(" cif_export - Exports a resource to a .cif file\n");
+	debugPrintf(" ciftree_export - Exports resources into a new ciftree\n");
+	debugPrintf(" chunk_list - Lists the chunks of an IFF file\n");
+	debugPrintf(" chunk_export - Exports a chunk of an IFF file\n");
+	debugPrintf(" chunk_hexdump - Shows the bytes of a chunk of an IFF file\n");
+	debugPrintf(" show_image - Draws an image on the screen\n");
+	debugPrintf(" export_image - Exports an image to a file\n");
+	debugPrintf(" play_video - Plays a video\n");
+	debugPrintf(" play_sound - Plays a sound\n");
+	debugPrintf("\n");
+	debugPrintf("Scenes and action records\n");
+	debugPrintf("-------------------------\n");
+	debugPrintf(" scene_id - Shows the current scene and frame\n");
+	debugPrintf(" load_scene - Goes to a scene\n");
+	debugPrintf(" list_actionrecords - Lists the action records of the current or a given scene\n");
+	debugPrintf(" actionrecord_export - Exports an action record to a file\n");
+	debugPrintf(" scan_ar_type - Finds the scenes with action records of a type\n");
+	debugPrintf(" list_includes - Lists the files that a scene includes\n");
+	debugPrintf(" find_include - Lists the scenes that include a file\n");
+	debugPrintf(" debug_hotspots - Shows or hides the outlines of the hotspots\n");
+	debugPrintf("\n");
+	debugPrintf("Game state\n");
+	debugPrintf("----------\n");
+	debugPrintf(" get_eventflags - Shows the event flags, or the given ones\n");
+	debugPrintf(" set_eventflags - Sets event flags, by label or name\n");
+	debugPrintf(" get_inventory - Shows which items the player has\n");
+	debugPrintf(" set_inventory - Gives or takes inventory items\n");
+	debugPrintf(" hold_item - Puts an item in the player's hand, or puts it away\n");
+	debugPrintf(" get_money - Shows the money of the player\n");
+	debugPrintf(" set_money - Sets the money of the player\n");
+	debugPrintf(" get_player_time - Shows the in-game time\n");
+	debugPrintf(" set_player_time - Sets the in-game time\n");
+	debugPrintf(" get_difficulty - Shows the difficulty level\n");
+	debugPrintf(" set_difficulty - Sets the difficulty level\n");
+	debugPrintf("\n");
+	debugPrintf("Sound and UI\n");
+	debugPrintf("------------\n");
+	debugPrintf(" sound_info - Lists the sounds playing on each channel\n");
+	debugPrintf(" stop_sound - Stops the sounds playing on the given channels\n");
+	debugPrintf(" ui_control - Shows, hides, enables or disables a UI control (Nancy16 and later)\n");
+#ifdef ENABLE_NANCY_V4
+	debugPrintf("\n");
+	debugPrintf("Scripts (Nancy19 and later)\n");
+	debugPrintf("---------------------------\n");
+	debugPrintf(" list_records - Lists the records of the scene scripts\n");
+	debugPrintf(" script_export - Exports a script, as compiled Lua\n");
+	debugPrintf(" list_vars - Lists the script variables and their values\n");
+	debugPrintf(" get_var - Shows a script variable\n");
+	debugPrintf(" set_var - Sets a script variable\n");
+	debugPrintf(" cheat_mode - Turns the cheat mode of the scripts on or off (Nancy20 and later)\n");
+	debugPrintf(" list_managers - Lists the managers of the scripts (Nancy22 and later)\n");
+#endif
+	debugPrintf("\n");
+	return true;
+}
+
 void NancyConsole::postEnter() {
 	GUI::Debugger::postEnter();
 	if (!_videoFile.empty()) {
diff --git a/engines/nancy/console.h b/engines/nancy/console.h
index ccdea250dc2..731851b8aef 100644
--- a/engines/nancy/console.h
+++ b/engines/nancy/console.h
@@ -41,6 +41,7 @@ public:
 	void postEnter() override;
 
 private:
+	bool Cmd_help(int argc, const char **argv);
 	bool Cmd_loadCal(int argc, const char **argv);
 	bool Cmd_cifExport(int argc, const char **argv);
 	bool Cmd_ciftreeExport(int argc, const char **argv);


Commit: 73f9513d3f13e4e46dcd67733436befb3a535580
    https://github.com/scummvm/scummvm/commit/73f9513d3f13e4e46dcd67733436befb3a535580
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:11+02:00

Commit Message:
NANCY: NANCY16: Squeeze the lines of scrolling text that don't fit

Drawing the font that stands in for Tahoma narrower made all of the
text of the UI look uneven, like the captions. The font is drawn as it
was again, and a line of scrolling text that is wider than its window
in it, but not in Tahoma, is squeezed to fit, like in the computer of
Nancy18 scene 2937.

Changed paths:
    engines/nancy/misc/hypertext.cpp
    engines/nancy/misc/hypertext.h


diff --git a/engines/nancy/misc/hypertext.cpp b/engines/nancy/misc/hypertext.cpp
index b27a8651819..5f064362cce 100644
--- a/engines/nancy/misc/hypertext.cpp
+++ b/engines/nancy/misc/hypertext.cpp
@@ -68,9 +68,27 @@ void HypertextParser::setDefaultTextRGB(byte r, byte g, byte b) {
 	_hasDefaultTextRGB = true;
 }
 
-void HypertextParser::drawTextRun(Graphics::ManagedSurface &surface, const Font *font, const Common::String &text, int x, int y, int width, int colorID) const {
-	if (font->getSystemFont()) {
-		font->getSystemFont()->drawString(&surface, text, x, y, width, getColorPixel(font, colorID));
+void HypertextParser::drawTextRun(Graphics::ManagedSurface &surface, const Font *font, const Common::String &text, int x, int y, int width, int colorID, float scale) const {
+	const Graphics::Font *systemFont = font->getSystemFont();
+	if (systemFont && scale < 1.0f) {
+		// Drawn at its own width over a copy of what is under it, then squeezed in place
+		const int textWidth = systemFont->getStringWidth(text);
+		const int textHeight = font->getFontHeight();
+		Common::Rect area(x, y, x + textWidth, y + textHeight);
+		area.clip(Common::Rect(surface.w, surface.h));
+		if (area.isEmpty()) {
+			return;
+		}
+
+		Graphics::ManagedSurface unscaled(area.width(), area.height(), surface.format);
+		unscaled.blitFrom(surface, area, Common::Point());
+		systemFont->drawString(&unscaled, text, 0, 0, area.width(), getColorPixel(font, colorID));
+
+		const int scaledWidth = MAX<int>((int)(area.width() * scale), 1);
+		surface.blitFrom(unscaled, Common::Rect(area.width(), area.height()),
+			Common::Rect(area.left, area.top, area.left + scaledWidth, area.bottom));
+	} else if (systemFont) {
+		systemFont->drawString(&surface, text, x, y, width, getColorPixel(font, colorID));
 	} else {
 		font->drawString(&surface, text, x, y, width, colorID);
 	}
@@ -457,6 +475,7 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
 			}
 
 			bool newWrappedLine = true; // Used to ensure color/font changes don't mess up hotspots
+			float lineScale = 1.0f;
 			while (!line.empty()) {
 				Common::String subLine;
 
@@ -548,6 +567,16 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
 					}
 				}
 
+				// The lines are broken where they would end in the narrower font of the
+				// original, so one that is too wide in the substitute font gets squeezed
+				if (newWrappedLine && _keepsWordsWhole && font->getWidthScale() < 1.0f) {
+					const int lineWidth = font->getStringWidth(line);
+					const int roomLeft = textBounds.width() - (int)horizontalOffset;
+					if (lineWidth > roomLeft && roomLeft > 0 && lineWidth * font->getWidthScale() <= roomLeft) {
+						lineScale = (float)roomLeft / lineWidth;
+					}
+				}
+
 				uint lineSizeNoSpace = 0;
 				for (uint i = 0; i < line.size(); ++i) {
 					if (!isSpace(line[i])) {
@@ -573,11 +602,11 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
 				// Draw the normal text
 				const int drawX = textBounds.left + horizontalOffset + (newLineStart ? 0 : leftOffsetNonNewline);
 				const int drawY = textBounds.top + _numDrawnLines * lineStep(font) + _imageVerticalOffset;
-				drawTextRun(_fullSurface, font, stringToDraw, drawX, drawY, _keepsWordsWhole ? _fullSurface.w - drawX : textBounds.width(), colorID);
+				drawTextRun(_fullSurface, font, stringToDraw, drawX, drawY, _keepsWordsWhole ? _fullSurface.w - drawX : textBounds.width(), colorID, lineScale);
 
 				// Underline the segment (the <u> markup toggle) in the text color.
 				if (underline && !stringToDraw.empty()) {
-					const int underlineWidth = font->getStringWidth(stringToDraw);
+					const int underlineWidth = (int)(font->getStringWidth(stringToDraw) * lineScale);
 					const int underlineY = drawY + font->getFontHeight() - 1;
 					_fullSurface.fillRect(Common::Rect(drawX, underlineY, drawX + underlineWidth, underlineY + 1),
 											getColorPixel(font, colorID));
@@ -611,7 +640,7 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint leftOffse
 				newWrappedLine = false;
 
 				if (subLine.size()) {
-					horizontalOffset += font->getStringWidth(subLine);
+					horizontalOffset += (uint)(font->getStringWidth(subLine) * lineScale);
 				} else {
 					break;
 				}
diff --git a/engines/nancy/misc/hypertext.h b/engines/nancy/misc/hypertext.h
index 8bfa40edb69..189e925c7d8 100644
--- a/engines/nancy/misc/hypertext.h
+++ b/engines/nancy/misc/hypertext.h
@@ -109,7 +109,8 @@ private:
 	// Color IDs are font color IDs, or this for the color given to setDefaultTextRGB()
 	static const int kDefaultRGB = -1;
 
-	void drawTextRun(Graphics::ManagedSurface &surface, const Font *font, const Common::String &text, int x, int y, int width, int colorID) const;
+	// A scale below 1 squeezes the text to that much of its width
+	void drawTextRun(Graphics::ManagedSurface &surface, const Font *font, const Common::String &text, int x, int y, int width, int colorID, float scale = 1.0f) const;
 	uint32 getColorPixel(const Font *font, int colorID) const;
 
 	bool _hasDefaultTextRGB = false;


Commit: 2dae83e603d1e79db1a303b57e88c35b872158f1
    https://github.com/scummvm/scummvm/commit/2dae83e603d1e79db1a303b57e88c35b872158f1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:12+02:00

Commit Message:
NANCY: NANCY16: Play nothing for a sound named "silence"

Like Nancy19, the games from Nancy16 on only stop the channel for a
sound named "silence". Nancy18 has a sound file of that name, twenty
seconds long, so using the dictionary on the Italian letter in Nancy18
scene 2017 took that long to show the translation.

Changed paths:
    engines/nancy/sound.cpp


diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 6ea4dec3148..44364d9108c 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -363,9 +363,10 @@ void SoundManager::loadSound(const SoundDescription &description, SoundEffectDes
 		return;
 	}
 
-	// Nancy19 and up play nothing for a sound named "silence", which only
-	// stops the channel
-	if (g_nancy->getGameType() >= kGameTypeNancy19 && soundName == "silence") {
+	// Nancy16 and up play nothing for a sound named "silence", which only stops
+	// the channel. Nancy18 has a Silence.HIS that lasts 20 seconds, which would
+	// hold up the records that wait for it, like the dictionary in scene 2017.
+	if (g_nancy->getGameType() >= kGameTypeNancy16 && soundName.equalsIgnoreCase("silence")) {
 		return;
 	}
 


Commit: 027160fe8dc095b2200a641fca554f7a9c16a787
    https://github.com/scummvm/scummvm/commit/027160fe8dc095b2200a641fca554f7a9c16a787
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:14+02:00

Commit Message:
NANCY: NANCY16: Fix debug_hotspots

The names of the hotspots were drawn with the letters of the first
font, which the Windows fonts of Nancy16 and later don't have, and the
game crashed. From Nancy17 on, every stream also cleared the hotspots
drawn before its own, so the ones of the scene were wiped out by the
streams running after it.

Changed paths:
    engines/nancy/action/actionmanager.cpp
    engines/nancy/state/scene.cpp


diff --git a/engines/nancy/action/actionmanager.cpp b/engines/nancy/action/actionmanager.cpp
index 9017c76d666..7ab066e64db 100644
--- a/engines/nancy/action/actionmanager.cpp
+++ b/engines/nancy/action/actionmanager.cpp
@@ -25,6 +25,8 @@
 #include "common/config-manager.h"
 #include "common/random.h"
 
+#include "graphics/fontman.h"
+
 #include "engines/nancy/nancy.h"
 #include "engines/nancy/input.h"
 #include "engines/nancy/sound.h"
@@ -993,13 +995,12 @@ void ActionManager::debugDrawHotspots() {
 	// Draws a rectangle around (non-puzzle) hotspots as well as the id
 	// and type of the owning ActionRecord. Hardcoded to font 0 since that's
 	// the smallest one available in the engine.
+	// The scene clears the picture once a frame, and shows or hides it
 	RenderObject &obj = NancySceneState._hotspotDebug;
 	if (ConfMan.getBool("debug_hotspots", Common::ConfigManager::kTransientDomain)) {
 		const Font *font = g_nancy->_graphics->getFont(0);
 		assert(font);
 		uint16 yOffset = NancySceneState.getViewport().getCurVerticalScroll();
-		obj.setVisible(true);
-		obj._drawSurface.clear(obj._drawSurface.getTransparentColor());
 
 		for (uint i = 0; i < _records.size(); ++i) {
 			ActionRecord *rec = _records[i];
@@ -1009,17 +1010,23 @@ void ActionManager::debugDrawHotspots() {
 				hotspot.clip(obj._drawSurface.getBounds());
 
 				if (!hotspot.isEmpty()) {
-					font->drawString(&obj._drawSurface, Common::String::format("%u, %s", i, rec->getRecordTypeName().c_str()),
-					hotspot.left, hotspot.bottom - font->getFontHeight() - 2, hotspot.width(), 0,
-					Graphics::kTextAlignCenter, 0, true);
+					const Common::String label = Common::String::format("%u, %s", i, rec->getRecordTypeName().c_str());
+
+					// The fonts of Nancy16 and up are Windows fonts, which have no letters of their
+					// own, and the first one isn't always set up, so ScummVM's font draws the names
+					if (g_nancy->getGameType() >= kGameTypeNancy16) {
+						const Graphics::Font *guiFont = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
+						guiFont->drawString(&obj._drawSurface, label, hotspot.left, hotspot.bottom - guiFont->getFontHeight() - 2,
+							hotspot.width(), obj._drawSurface.format.ARGBToColor(255, 255, 255, 255), Graphics::kTextAlignCenter, 0, true);
+					} else {
+						font->drawString(&obj._drawSurface, label, hotspot.left, hotspot.bottom - font->getFontHeight() - 2,
+							hotspot.width(), 0, Graphics::kTextAlignCenter, 0, true);
+					}
+
 					obj._drawSurface.frameRect(hotspot, g_nancy->getGameType() <= kGameTypeNancy12 ? 0xFFFFFF : 0xFFFFFFFF);
 				}
 			}
 		}
-	} else {
-		if (obj.isVisible()) {
-			obj.setVisible(false);
-		}
 	}
 }
 
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 9d17bdcfb9f..7d39cbec21e 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -2627,6 +2627,14 @@ void Scene::run() {
 	}
 #endif
 
+	// The hotspots of every stream go on the same picture, which starts out empty
+	const bool showsHotspots = ConfMan.getBool("debug_hotspots", Common::ConfigManager::kTransientDomain);
+	_hotspotDebug.setVisible(showsHotspots);
+	if (showsHotspots) {
+		_hotspotDebug._drawSurface.clear(_hotspotDebug._drawSurface.getTransparentColor());
+		_hotspotDebug.setNeedsRedraw(true);
+	}
+
 	_streams.process();
 
 	// The scenes of a loaded game have all started by now


Commit: 497df19a43ff70c4c4c6f5cf665775c7e4e2713c
    https://github.com/scummvm/scummvm/commit/497df19a43ff70c4c4c6f5cf665775c7e4e2713c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:16+02:00

Commit Message:
NANCY: TVD: Fix secondary movies only drawing their upper-left quarter

The size check added for oversized video descriptions compared the
source rect against the decoder's frame size. TVD's small format videos
are decoded at half size and doubled, so the source rect was cut down
to a quarter of the frame. Check against the doubled frame instead.
This broke the owl attacking Margaret, Mikhail's animations in the
endgame and the "The End" text.

Fix #17486

Changed paths:
    engines/nancy/action/secondarymovie.cpp


diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index 13443f71535..3b4034d807d 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -1209,15 +1209,15 @@ void PlaySecondaryMovie::applyVideoDesc(int descID) {
 	// The videoDesc's size might be larger than the decoded video (for example, nancy10's
 	// COR_AceFidgetEars_ANIM, and nancy12's PAR_ArcadeAnimationB); clamp here to avoid
 	// reading out-of-bounds during draw. (Adjust destRect too: avoid stretching)
-	const int16 decodedWidth = (int16)_decoder.getWidth();
-	if (srcRect.width() > decodedWidth) {
-		srcRect.setWidth(decodedWidth);
-		destRect.setWidth(decodedWidth);
-	}
-	const int16 decodedHeight = (int16)_decoder.getHeight();
-	if (srcRect.height() > decodedHeight) {
-		srcRect.setHeight(decodedHeight);
-		destRect.setHeight(decodedHeight);
+	// Clamp to the full frame, not the decoder: TVD's small format videos are
+	// decoded at half size and doubled.
+	if (srcRect.width() > _fullFrame.w) {
+		srcRect.setWidth(_fullFrame.w);
+		destRect.setWidth(_fullFrame.w);
+	}
+	if (srcRect.height() > _fullFrame.h) {
+		srcRect.setHeight(_fullFrame.h);
+		destRect.setHeight(_fullFrame.h);
 	}
 
 	_drawSurface.create(_fullFrame, srcRect);


Commit: de7373b3903b958dce5144dccc6b7271760d3fd2
    https://github.com/scummvm/scummvm/commit/de7373b3903b958dce5144dccc6b7271760d3fd2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:17+02:00

Commit Message:
NANCY: TVD: Fix game type assignment

Changed paths:
    engines/nancy/detection.h


diff --git a/engines/nancy/detection.h b/engines/nancy/detection.h
index b3f2aa981ba..b0dd9e89170 100644
--- a/engines/nancy/detection.h
+++ b/engines/nancy/detection.h
@@ -74,7 +74,7 @@ struct GameIdToType {
 };
 
 static const GameIdToType gameIdToType[] = {
-	{"vampire", kGameTypeVampire },
+	{"vampirediaries", kGameTypeVampire },
 	{ "nancy1", kGameTypeNancy1 },
 	{ "nancy2", kGameTypeNancy2 },
 	{ "nancy3", kGameTypeNancy3 },


Commit: e0b170cde308c15f4c7338b7a8a0f4ecfe3f205f
    https://github.com/scummvm/scummvm/commit/e0b170cde308c15f4c7338b7a8a0f4ecfe3f205f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-01T09:38:18+02:00

Commit Message:
NANCY: NANCY18: Fix being sent back at the start of the sentry rooms

The rooms behind the gate of Nancy18 scene 3805 start with the player
on the zone of the door they came in through, which takes them back.
Like the zones of the driving puzzles, a zone now only does something
when the player walks into it, so the player can enter the rooms.

Changed paths:
    engines/nancy/action/puzzle/sentrypuzzle.cpp
    engines/nancy/action/puzzle/sentrypuzzle.h


diff --git a/engines/nancy/action/puzzle/sentrypuzzle.cpp b/engines/nancy/action/puzzle/sentrypuzzle.cpp
index 7f7839bf854..64d6e9c9821 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.cpp
+++ b/engines/nancy/action/puzzle/sentrypuzzle.cpp
@@ -163,6 +163,12 @@ void SentryPuzzle::init() {
 	_playerY = _targetY = (startRect.top + startRect.bottom) / 2;
 	_playerHeading = startHeading * M_PI / 180.0;
 
+	const Common::Rect playerRect = getPlayerRect(_playerX, _playerY);
+	_isPlayerInZone.resize(_zones.size());
+	for (uint i = 0; i < _zones.size(); ++i) {
+		_isPlayerInZone[i] = _zones[i].rect.intersects(playerRect);
+	}
+
 	for (Sentry &sentry : _sentries) {
 		g_nancy->_resource->loadImage(sentry.imageName, sentry.image);
 
@@ -381,11 +387,17 @@ bool SentryPuzzle::doesBeamHit(const Sentry &sentry, const Common::Rect &rect) c
 	return false;
 }
 
+// A zone sets its flag when the player walks into it. The player starts out inside
+// the zone of the door they came in through, which only takes them back once they
+// have left it and come back, like in the room behind the gate of Nancy18 scene 3805.
 void SentryPuzzle::checkZones() {
 	const Common::Rect rect = getPlayerRect(_playerX, _playerY);
+	for (uint i = 0; i < _zones.size(); ++i) {
+		const ActionZone &zone = _zones[i];
+		const bool wasInZone = _isPlayerInZone[i];
+		_isPlayerInZone[i] = zone.rect.intersects(rect);
 
-	for (const ActionZone &zone : _zones) {
-		if (zone.type != kZoneEventFlag || !zone.rect.intersects(rect)) {
+		if (zone.type != kZoneEventFlag || !_isPlayerInZone[i] || wasInZone) {
 			continue;
 		}
 
diff --git a/engines/nancy/action/puzzle/sentrypuzzle.h b/engines/nancy/action/puzzle/sentrypuzzle.h
index a2453625873..93ab4dac63c 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.h
+++ b/engines/nancy/action/puzzle/sentrypuzzle.h
@@ -131,6 +131,7 @@ protected:
 	Common::Array<Common::Rect> _playerFrameSrcs;
 	Common::Array<Sentry> _sentries;
 	Common::Array<ActionZone> _zones;
+	Common::Array<bool> _isPlayerInZone;
 
 	// -- Runtime --
 	Graphics::ManagedSurface _map;




More information about the Scummvm-git-logs mailing list