[Scummvm-git-logs] scummvm master -> 6725db80577821a3d028a039730dd2504ea1c485

bluegr noreply at scummvm.org
Sun May 10 13:13:21 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:
6725db8057 NANCY: Fix broken web search links after saving/loading in Nancy9


Commit: 6725db80577821a3d028a039730dd2504ea1c485
    https://github.com/scummvm/scummvm/commit/6725db80577821a3d028a039730dd2504ea1c485
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-10T16:12:48+03:00

Commit Message:
NANCY: Fix broken web search links after saving/loading in Nancy9

These are autoexec hotspots, with an underlying scene ID, which points
to the scene that renders the website of each search result. The
underlying functionality for this feature was implemented in commit
b2231ac, which added the new scene ID field. Unfortunately, when the
new field was added, it was not added to the PuzzleData sync code, so
these fields are not persistent. Adding these fields to the journal
entry sync code will mean that all existing saved games would be
broken, with no easy way of detecting if a saved game is broken or not.
Fortunately for us, this is URL functionality is only used in a
single scene in nancy9, 2491 (the browser in Nancy's laptop), and the
relevant records are set up by the game scripts when the scene starts.
Thus, for this scene, override the scene ID of these journal records
from the values in the scene scripts, which fixes the functionality
of the search links.

Fix #16776

Changed paths:
    engines/nancy/action/datarecords.cpp
    engines/nancy/puzzledata.cpp


diff --git a/engines/nancy/action/datarecords.cpp b/engines/nancy/action/datarecords.cpp
index 68fcb42da13..b85f73dfce4 100644
--- a/engines/nancy/action/datarecords.cpp
+++ b/engines/nancy/action/datarecords.cpp
@@ -438,6 +438,22 @@ void ModifyListEntry::execute() {
 			array.push_back(JournalData::Entry(_stringID, _mark, _sceneID));
 		}
 
+		if (found && g_nancy->getGameType() == kGameTypeNancy9 && NancySceneState.getSceneInfo().sceneID == 2491) {
+			// WORKAROUND: We do not persist the sceneID information for journal entries in
+			// nancy9 saved games, due to an oversight when the sceneID field was added. This
+			// means that for the search functionality in the laptop (which is the only place
+			// where the sceneID field is used in nancy9), the sceneID values will always be
+			// lost on save/load. Fortunately, these are always initialized by the game scripts,
+			// so we can use those script values instead. This code will ensure that the sceneID
+			// values are obtained from the game scripts in that scene, instead of the
+			// broken saved values, so the search functionality will work correctly even after
+			// save/load. Refer to JournalData::synchronize(), for a note on the missing sync
+			// of the SceneID field.
+			if (_stringID.hasPrefix("S0") && found->mark == _mark && _mark >= 10 &&
+				found->sceneID == kNoScene && _sceneID != kNoScene) {
+				found->sceneID = _sceneID;
+			}
+		}
 		break;
 	case kDelete:
 		if (found) {
diff --git a/engines/nancy/puzzledata.cpp b/engines/nancy/puzzledata.cpp
index 71a3584e531..39b7e33bf8b 100644
--- a/engines/nancy/puzzledata.cpp
+++ b/engines/nancy/puzzledata.cpp
@@ -149,6 +149,14 @@ void JournalData::synchronize(Common::Serializer &ser) {
 				entry.push_back(Entry());
 				ser.syncString(entry.back().stringID);
 				ser.syncAsUint16LE(entry.back().mark);
+				// NOTE: We do not persist sceneID for journal entries in nancy9.
+				// Unfortunately, this field was added but the sync code was not
+				// updated, so it is always lost on save/load. Fortunately for us,
+				// this field is only used in scene 2491, when using the search
+				// functionality in the laptop, and it's always initialized by the
+				// game scripts, so we can use the script values instead in that
+				// scene. Refer to the workaround in ModifyListEntry::execute(),
+				// which fixes these values for that scene.
 			}
 		}
 	} else {




More information about the Scummvm-git-logs mailing list