[Scummvm-git-logs] scummvm master -> 27fb4f0e1ce67ead211325a695e631f706644423

sluicebox noreply at scummvm.org
Wed Oct 16 22:09:31 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:
27fb4f0e1c SCI: Test `FSNode::getChildren` return value


Commit: 27fb4f0e1ce67ead211325a695e631f706644423
    https://github.com/scummvm/scummvm/commit/27fb4f0e1ce67ead211325a695e631f706644423
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-10-16T16:09:20-06:00

Commit Message:
SCI: Test `FSNode::getChildren` return value

CID 1563746

Changed paths:
    engines/sci/detection_internal.cpp


diff --git a/engines/sci/detection_internal.cpp b/engines/sci/detection_internal.cpp
index 8721968fab3..0be749beda0 100644
--- a/engines/sci/detection_internal.cpp
+++ b/engines/sci/detection_internal.cpp
@@ -137,18 +137,19 @@ Common::String customizeGuiOptions(Common::Path gamePath, Common::String guiOpti
 		return guiOptions + GUIO_RENDERWIN_256C + GUIO_RENDERWIN_16C;
 
 	Common::FSNode node(gamePath);
-
-	if (!node.exists()) {
+	Common::FSList files;
+	if (!node.getChildren(files, Common::FSNode::kListFilesOnly)) {
 		warning("Game path '%s' could not be accessed", gamePath.toString().c_str());
 		return guiOptions;
 	}
 
-	Common::FSList files;
-	node.getChildren(files, Common::FSNode::kListFilesOnly);
 	for (Common::FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
 		for (int ii = 0; ii < ARRAYSIZE(rmodes); ii++) {
-			if ((version == SCI_VERSION_NONE || (version >= rmodes[ii].min && version <= rmodes[ii].max)) && i->getFileName().equalsIgnoreCase(rmodes[ii].gfxDriverName))
-				guiOptions += rmodes[ii].guio;
+			if (version == SCI_VERSION_NONE || (rmodes[ii].min <= version && version <= rmodes[ii].max)) {
+				if (i->getFileName().equalsIgnoreCase(rmodes[ii].gfxDriverName)) {
+					guiOptions += rmodes[ii].guio;
+				}
+			}
 		}
 	}
 




More information about the Scummvm-git-logs mailing list