[Scummvm-git-logs] scummvm master -> 4ef78da31c618ce2bb61bc4bf161bc694a63024e

elasota noreply at scummvm.org
Mon Aug 5 02:27:12 UTC 2024


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:
4ef78da31c MTROPOLIS: Ignore transition flags if the dest scene is the current scene


Commit: 4ef78da31c618ce2bb61bc4bf161bc694a63024e
    https://github.com/scummvm/scummvm/commit/4ef78da31c618ce2bb61bc4bf161bc694a63024e
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-08-04T22:26:53-04:00

Commit Message:
MTROPOLIS: Ignore transition flags if the dest scene is the current scene

Fixes getting stuck in the menu in SPQR after pressing Esc twice

Changed paths:
    engines/mtropolis/runtime.cpp


diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index e236bae959d..93ed0c71988 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -3070,8 +3070,13 @@ MiniscriptInstructionOutcome WorldManagerInterface::setCurrentScene(MiniscriptTh
 		return kMiniscriptInstructionOutcomeFailed;
 	}
 
+	// Note that this does NOT prevent transitioning to the same scene, which is intentional.
+	// Transitioning to the current scene is allowed (and will fire Scene Ended+Scene Started events)
 	bool addToReturnList = (_opInt & 0x02) != 0;
 	bool addToDest = (_opInt & 0x01) != 0;
+
+	_opInt = 0;	// Possibly inaccurate
+
 	thread->getRuntime()->addSceneStateTransition(HighLevelSceneTransition(scene->getSelfReference().lock().staticCast<Structural>(), HighLevelSceneTransition::kTypeChangeToScene, addToDest, addToReturnList));
 
 	return kMiniscriptInstructionOutcomeContinue;
@@ -5628,7 +5633,10 @@ void Runtime::executeHighLevelSceneTransition(const HighLevelSceneTransition &tr
 	case HighLevelSceneTransition::kTypeChangeToScene: {
 			const Common::SharedPtr<Structural> targetScene = transition.scene;
 
-			if (transition.addToDestinationScene || transition.addToReturnList) {
+			// This check may not be accurate, but we need to avoid adding the existing scene to the return list.
+			// SPQR depends on this behavior: Hitting Esc while in the menu will fire off another transition to
+			// the menu scene with addToReturnList set.  We want to avoid returning back to 
+			if ((transition.addToDestinationScene || transition.addToReturnList) && targetScene != _activeMainScene) {
 				SceneReturnListEntry returnListEntry;
 				returnListEntry.isAddToDestinationSceneTransition = transition.addToDestinationScene;
 				returnListEntry.scene = _activeMainScene;




More information about the Scummvm-git-logs mailing list