[Scummvm-git-logs] scummvm master -> 0905e16a9bd015e2278932ff4e837d6363569655

bluegr noreply at scummvm.org
Wed Nov 6 08:37:14 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:
0905e16a9b AGOS: Add a workaround when an invalid path is selected - fixes bug 6356


Commit: 0905e16a9bd015e2278932ff4e837d6363569655
    https://github.com/scummvm/scummvm/commit/0905e16a9bd015e2278932ff4e837d6363569655
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-06T10:36:35+02:00

Commit Message:
AGOS: Add a workaround when an invalid path is selected - fixes bug 6356

Changed paths:
    engines/agos/vga_s1.cpp


diff --git a/engines/agos/vga_s1.cpp b/engines/agos/vga_s1.cpp
index 9e4ea8e6b89..cc6e4ae344f 100644
--- a/engines/agos/vga_s1.cpp
+++ b/engines/agos/vga_s1.cpp
@@ -179,6 +179,15 @@ void AGOSEngine::vc47_addToVar() {
 
 void AGOSEngine::vc48_setPathFinder() {
 	uint16 a = (uint16)_variableArrayPtr[12];
+	// WORKAROUND: Check if the selected path is valid. There are cases
+	// where an invalid path is selected, such as when loading a save in
+	// the Dwarf Cave in Simon 1 (bug #6356). In such cases, we select
+	// the first available path, which fixes the problem in Simon 1.
+	if (!_pathFindArray[a - 1]) {
+		warning("vc48_setPathFinder: Invalid path, attempting to correct");
+		a = 1;
+	}
+
 	const uint16 *p = _pathFindArray[a - 1];
 
 	uint b = (uint16)_variableArray[13];




More information about the Scummvm-git-logs mailing list