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

AndywinXp noreply at scummvm.org
Sun May 21 18:16:24 UTC 2023


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

Summary:
9926908983 SCUMM: SAMNMAX: Fix bug #14468
1a23804e52 SCUMM: SAMNMAX: Don't run post-load script for non-available quicksaves
a5fe613c3f SCUMM: SAMNMAX: Post-load fix for savegames presenting bug #14467


Commit: 9926908983b14f0479efd76e4eb60faac4522016
    https://github.com/scummvm/scummvm/commit/9926908983b14f0479efd76e4eb60faac4522016
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-05-21T20:16:14+02:00

Commit Message:
SCUMM: SAMNMAX: Fix bug #14468

I really have no idea why I wrote the code in such a way that
it attempted to load stuff that was never saved in the first place,
and I guess we'll never know. Findings by athrxx!

Changed paths:
    engines/scumm/gfx_gui.cpp
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 2574a893be5..ccd187996d5 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -1750,10 +1750,6 @@ void ScummEngine::restoreCursorPostMenu() {
 		setCursorFromBuffer(_curGrabbedCursor, _curCursorWidth, _curCursorHeight, _curCursorWidth, true);
 		free(_curGrabbedCursor);
 		_curGrabbedCursor = nullptr;
-	} else if (_game.version == 6 && _game.id != GID_TENTACLE) {
-		setCursorHotspot(_curCursorHotspotX, _curCursorHotspotY);
-		_cursor.width = _curCursorWidth;
-		_cursor.height = _curCursorHeight;
 	}
 
 	// Restore the old cursor state...
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index ac8ada3f3b6..b87107cab79 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1438,6 +1438,17 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	s.syncAsSint16LE(_cursor.height, VER(20));
 	s.syncAsSint16LE(_cursor.hotspotX, VER(20));
 	s.syncAsSint16LE(_cursor.hotspotY, VER(20));
+
+	// Post-load fix for broken SAMNMAX savegames which contain invalid
+	// cursor values; the value we're setting here should not count since
+	// it's being replaced by the post-load script, as long as it's not zero.
+	if (_game.version == 6 && (_cursor.width == 0 || _cursor.height == 0)) {
+		_cursor.width = 15;
+		_cursor.height = 15;
+		_cursor.hotspotX = 7;
+		_cursor.hotspotY = 7;
+	}
+
 	s.syncAsByte(_cursor.animate, VER(20));
 	s.syncAsByte(_cursor.animateIndex, VER(20));
 


Commit: 1a23804e52d4e5ac9c132323b0ff60a7956f6074
    https://github.com/scummvm/scummvm/commit/1a23804e52d4e5ac9c132323b0ff60a7956f6074
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-05-21T20:16:14+02:00

Commit Message:
SCUMM: SAMNMAX: Don't run post-load script for non-available quicksaves

Fixes part of #14467

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 3092a04dd12..92762615fd5 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2824,7 +2824,7 @@ void ScummEngine::scummLoop_handleSaveLoad() {
 			// If we are here, it means that we are loading a game from the ScummVM menu;
 			// let's call the exit save/load script (only used in v6) to restore the cursor
 			// properly.
-			if (VAR_SAVELOAD_SCRIPT2 != 0xFF && _currentRoom != 0)
+			if (success && VAR_SAVELOAD_SCRIPT2 != 0xFF && _currentRoom != 0)
 				runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, nullptr);
 		}
 


Commit: a5fe613c3f957eaa2e095b29825bca6e2e7830dc
    https://github.com/scummvm/scummvm/commit/a5fe613c3f957eaa2e095b29825bca6e2e7830dc
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-05-21T20:16:14+02:00

Commit Message:
SCUMM: SAMNMAX: Post-load fix for savegames presenting bug #14467

The root cause of the issue is not solved yet, but this would allow for the
affected savegames to still work.

Changed paths:
    engines/scumm/script_v6.cpp


diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 6e941aff65d..747a099a710 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1043,6 +1043,11 @@ void ScummEngine_v6::o6_cursorCommand() {
 			} else {
 				obj = popRoomAndObj(&room);
 			}
+
+			// Post-load fix for broken SAMNMAX savegames (see bug no. 14467)
+			if (_game.id == GID_SAMNMAX && obj == 0 && room == 93)
+				break;
+
 			setCursorFromImg(obj, room, 1);
 			break;
 		}




More information about the Scummvm-git-logs mailing list