[Scummvm-git-logs] scummvm master -> 1338d7669482efba7f431eb6e4a6e7e22f424968

criezy noreply at scummvm.org
Sun Jul 2 21:41:33 UTC 2023


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

Summary:
1338d76694 SWORD1: Fix softlock when saving in hospital


Commit: 1338d7669482efba7f431eb6e4a6e7e22f424968
    https://github.com/scummvm/scummvm/commit/1338d7669482efba7f431eb6e4a6e7e22f424968
Author: PushmePullyu (127053144+PushmePullyu at users.noreply.github.com)
Date: 2023-07-02T22:41:30+01:00

Commit Message:
SWORD1: Fix softlock when saving in hospital

Reset _scriptVars[SAM_RETURNING] when changing to scene 33.

In the hospital, after pulling the plug from the socket, it is
possible to save the game before Sam the janitor returns to his
position.

On loading this save, he will be reset, but _scriptVars[SAM_RETURNING]
will be set to 1.

This causes a softlock when the plug is pulled again.

Fixes #14521

Changed paths:
    engines/sword1/logic.cpp


diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index c111b335ac6..017ec030e20 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -111,6 +111,13 @@ void Logic::newScreen(uint32 screen) {
 	if ((screen == 71) && (SwordEngine::isPsx()))
 		_scriptVars[TOP_MENU_DISABLED] = 0;
 
+	// work around bug #14521
+	// In the hospital, after pulling the plug from the socket, it is possible to save the game before Sam the janitor
+	// returns to his position. On loading this save, he will be reset, but _scriptVars[SAM_RETURNING] will still be set to 1.
+	// This causes a softlock when the plug is pulled again.
+	if (screen == 33)
+		_scriptVars[SAM_RETURNING] = 0;
+
 	if (SwordEngine::_systemVars.justRestoredGame) { // if we've just restored a game - we want George to be exactly as saved
 		fnAddHuman(NULL, 0, 0, 0, 0, 0, 0, 0);
 		if (_scriptVars[GEORGE_WALKING]) { // except that if George was walking when we saveed the game




More information about the Scummvm-git-logs mailing list