[Scummvm-git-logs] scummvm master -> b2927ff1a95ca96805787e0dfe05102d385559b1
bluegr
noreply at scummvm.org
Wed Dec 2 07:49:50 UTC 2026
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
20678d507a NANCY: NANCY18: Restart the sentry rooms where the player came in
d3ce61f3e7 NANCY: NANCY18: Fix the power circuits never counting as solved
c87acfa4f8 NANCY: NANCY18: Don't step further into a sentry room on arrival
b2927ff1a9 NANCY: NANCY18: Don't cut off a line that follows another on the same channel
Commit: 20678d507a0638898ad840eed4024078af157f86
https://github.com/scummvm/scummvm/commit/20678d507a0638898ad840eed4024078af157f86
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-02T09:49:26+02:00
Commit Message:
NANCY: NANCY18: Restart the sentry rooms where the player came in
A sentry room keeps the place of the player for when they come back.
Being caught stored the place they were caught at, which could be on
the path of a sentry, so that the room started over with the player
caught right away, again and again. Like the original, a caught player
now starts over at the place they came in at.
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 64d6e9c9821..1f4fd5be5d9 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.cpp
+++ b/engines/nancy/action/puzzle/sentrypuzzle.cpp
@@ -159,6 +159,9 @@ void SentryPuzzle::init() {
startHeading = values[kSavedHeading];
}
+ _entryRect = startRect;
+ _entryHeading = startHeading;
+
_playerX = _targetX = (startRect.left + startRect.right) / 2;
_playerY = _targetY = (startRect.top + startRect.bottom) / 2;
_playerHeading = startHeading * M_PI / 180.0;
@@ -527,6 +530,12 @@ void SentryPuzzle::execute() {
_isSeen = true;
_isPlayerMoving = false;
NancySceneState.setEventFlag(_seenFlag, g_nancy->_true);
+
+ // The room keeps the place the player came in at, not the one they were caught
+ // at, which can be on the path of a sentry
+ if (!_name.empty()) {
+ storeSentryPosition(_name, _entryRect, _entryHeading);
+ }
}
}
diff --git a/engines/nancy/action/puzzle/sentrypuzzle.h b/engines/nancy/action/puzzle/sentrypuzzle.h
index 93ab4dac63c..bea8e5ecae9 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.h
+++ b/engines/nancy/action/puzzle/sentrypuzzle.h
@@ -136,6 +136,8 @@ protected:
// -- Runtime --
Graphics::ManagedSurface _map;
Common::Point _playerSize;
+ Common::Rect _entryRect; // where the player came in, for starting over after being caught
+ int32 _entryHeading = 0;
double _playerX = 0;
double _playerY = 0;
double _playerHeading = 0; // in radians, counterclockwise
Commit: d3ce61f3e7f28e109eebb77cd9ab3110fff63e4b
https://github.com/scummvm/scummvm/commit/d3ce61f3e7f28e109eebb77cd9ab3110fff63e4b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-02T09:49:28+02:00
Commit Message:
NANCY: NANCY18: Fix the power circuits never counting as solved
Solving the lock of a power circuit in Nancy18 scenes 3890-3893 set
its event flag together with the change to the next scene, so the
records of the circuit scene that turn the power off never got to
manipulate it. Like the original, the flag is now set as soon as the
lock is solved, and the scene changes once the solve sound has
finished.
Changed paths:
engines/nancy/action/puzzle/sequencelockpuzzle.cpp
diff --git a/engines/nancy/action/puzzle/sequencelockpuzzle.cpp b/engines/nancy/action/puzzle/sequencelockpuzzle.cpp
index 81bb30dbd74..352581c398c 100644
--- a/engines/nancy/action/puzzle/sequencelockpuzzle.cpp
+++ b/engines/nancy/action/puzzle/sequencelockpuzzle.cpp
@@ -185,8 +185,12 @@ void SequenceLockPuzzle::execute() {
}
}
+ // The flag is set at once, so that the records of the scene can act on it
+ // while the solve sound plays, like the ones of Nancy18 scenes 3890-3893
+ // that turn off the power circuits
if (_numPressed == _switches.size() && !isMoving) {
_isSolved = true;
+ NancySceneState.setEventFlag(_solveScene._flag);
playSoundBlock(_solveSoundBlock);
_state = kActionTrigger;
}
@@ -200,7 +204,7 @@ void SequenceLockPuzzle::execute() {
break;
}
- _solveScene.execute();
+ NancySceneState.changeScene(_solveScene._sceneChange);
} else {
_exitScene.execute();
}
Commit: c87acfa4f8c9a6db3899212695dd6f5f97e823e4
https://github.com/scummvm/scummvm/commit/c87acfa4f8c9a6db3899212695dd6f5f97e823e4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-02T09:49:29+02:00
Commit Message:
NANCY: NANCY18: Don't step further into a sentry room on arrival
On arrival in a sentry room, the player could take a step further in,
which could be into the beam of a sentry, as when entering Nancy18
scene 3871 from below. There were two causes, both now fixed to work
like the original:
- The zones took the player as being inside them as soon as any part
of them touched, so the next room came up almost as soon as the
player stepped toward a door, while an arrow key was still held.
The middle of the player now decides whether they are inside a
zone, so a door takes them out once they are halfway into its cell.
- A mouse button held down from the room before made the player walk
on. A room now only follows the mouse after a press made in it.
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 1f4fd5be5d9..35acd36eb14 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.cpp
+++ b/engines/nancy/action/puzzle/sentrypuzzle.cpp
@@ -166,10 +166,9 @@ 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);
+ _isPlayerInZone[i] = isPlayerInZone(_zones[i]);
}
for (Sentry &sentry : _sentries) {
@@ -390,15 +389,20 @@ bool SentryPuzzle::doesBeamHit(const Sentry &sentry, const Common::Rect &rect) c
return false;
}
+// The middle of the player is what is in a zone or not. A door zone then only takes
+// the player out once they are halfway into the door's cell.
+bool SentryPuzzle::isPlayerInZone(const ActionZone &zone) const {
+ return zone.rect.contains((int)_playerX, (int)_playerY);
+}
+
// 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);
+ _isPlayerInZone[i] = isPlayerInZone(zone);
if (zone.type != kZoneEventFlag || !_isPlayerInZone[i] || wasInZone) {
continue;
@@ -556,6 +560,17 @@ void SentryPuzzle::handleInput(NancyInput &input) {
_heldKeys = input.input & (NancyInput::kMoveUp | NancyInput::kMoveDown | NancyInput::kMoveLeft | NancyInput::kMoveRight);
+ const Common::Rect viewportBounds = NancySceneState.getViewport().getBounds();
+ const bool isInViewport = NancySceneState.getViewport().convertViewportToScreen(viewportBounds).contains(input.mousePos);
+
+ // Only a press made in this room walks the player. One still held from the room
+ // they came from would take them a step further in, maybe into a beam.
+ if (input.input & NancyInput::kLeftMouseButtonDown) {
+ _hasPressedMouse = isInViewport;
+ } else if (input.input & NancyInput::kLeftMouseButtonUp) {
+ _hasPressedMouse = false;
+ }
+
if (hoverExitHotspot(input)) {
_isMouseHeld = false;
@@ -567,9 +582,7 @@ void SentryPuzzle::handleInput(NancyInput &input) {
return;
}
- const Common::Rect viewportBounds = NancySceneState.getViewport().getBounds();
- const bool isInViewport = NancySceneState.getViewport().convertViewportToScreen(viewportBounds).contains(input.mousePos);
- _isMouseHeld = isInViewport && (input.input & (NancyInput::kLeftMouseButtonDown | NancyInput::kLeftMouseButtonHeld));
+ _isMouseHeld = isInViewport && _hasPressedMouse;
if (_isMouseHeld) {
const Common::Rect mouseRect = NancySceneState.getViewport().convertScreenToViewport(
diff --git a/engines/nancy/action/puzzle/sentrypuzzle.h b/engines/nancy/action/puzzle/sentrypuzzle.h
index bea8e5ecae9..3ad9aabe71b 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.h
+++ b/engines/nancy/action/puzzle/sentrypuzzle.h
@@ -113,6 +113,7 @@ protected:
void moveSentry(Sentry &sentry, uint32 elapsed);
void castBeam(Sentry &sentry);
bool doesBeamHit(const Sentry &sentry, const Common::Rect &rect) const;
+ bool isPlayerInZone(const ActionZone &zone) const;
void checkZones();
void storePlayerPosition();
@@ -148,6 +149,7 @@ protected:
// What the player asks for
bool _isMouseHeld = false;
+ bool _hasPressedMouse = false; // the button went down in this room and is still down
Common::Point _mousePos;
uint16 _heldKeys = 0;
Commit: b2927ff1a95ca96805787e0dfe05102d385559b1
https://github.com/scummvm/scummvm/commit/b2927ff1a95ca96805787e0dfe05102d385559b1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-02T09:49:30+02:00
Commit Message:
NANCY: NANCY18: Don't cut off a line that follows another on the same channel
When a sound record's sound ended, the record stopped its channel one
update later. By then, a record waiting for that channel to be free
could already have started the next line on it, and that line was cut
off. This happened in Nancy18 scene 5490, where Hellmut's second line
was never heard. The original doesn't stop the channel there, so the
record now leaves it alone if another sound has been loaded on it since.
Changed paths:
engines/nancy/action/soundrecords.cpp
engines/nancy/action/soundrecords.h
diff --git a/engines/nancy/action/soundrecords.cpp b/engines/nancy/action/soundrecords.cpp
index 6c24dc5131d..68aefbf3141 100644
--- a/engines/nancy/action/soundrecords.cpp
+++ b/engines/nancy/action/soundrecords.cpp
@@ -325,6 +325,7 @@ void PlaySound::execute() {
// playing restarts from the beginning instead of being left alone
g_nancy->_sound->loadSound(_sound, &_soundEffect, true);
g_nancy->_sound->playSound(_sound);
+ _channelSerial = g_nancy->_sound->getChannelSerial(_sound.channelID);
// Nancy13+ shows the sound's subtitle (resolved from its name) in the
// game textbox. Earlier games use the explicit PlaySoundCC records instead.
@@ -389,7 +390,10 @@ void PlaySound::execute() {
NancySceneState.setEventFlag(_flag);
}
- if (!_changeSceneImmediately) {
+ // A record waiting for the end of this sound may already have started its
+ // own sound on the channel, and that one must keep playing (the line that
+ // follows HBL_Bust60ca on channel 24 in Nancy18 scene 5490)
+ if (!_changeSceneImmediately && g_nancy->_sound->getChannelSerial(_sound.channelID) == _channelSerial) {
g_nancy->_sound->stopSound(_sound);
}
diff --git a/engines/nancy/action/soundrecords.h b/engines/nancy/action/soundrecords.h
index 4898f072ff1..1318a4b609c 100644
--- a/engines/nancy/action/soundrecords.h
+++ b/engines/nancy/action/soundrecords.h
@@ -135,6 +135,7 @@ public:
// Nancy13+: a list of flags (was a single flag) and a multi-name random sound.
Common::Array<FlagDescription> _flags;
byte _afterSoundAction = 0; // Nancy13+: 1 dismisses the text box overlay
+ uint32 _channelSerial = 0; // tells whether another sound has been loaded on the channel since
// Subtitle shown in the game textbox while the sound plays. In Nancy13+ this
// is resolved from the sound name (see readDataNancy13); earlier games store
More information about the Scummvm-git-logs
mailing list