From 3be26282b39c043e684978ea052914897d6e9222 Mon Sep 17 00:00:00 2001 From: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com> Date: Tue, 22 Nov 2022 16:31:38 +0300 Subject: [PATCH] Fixed lower case .dat file loading. Ref #164. --- SpaceCadetPinball/pb.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/SpaceCadetPinball/pb.cpp b/SpaceCadetPinball/pb.cpp index 54ea982..da6c1a7 100644 --- a/SpaceCadetPinball/pb.cpp +++ b/SpaceCadetPinball/pb.cpp @@ -145,14 +145,13 @@ void pb::SelectDatFile(const std::vector& dataSearchPaths) } for (auto path : dataSearchPaths) { - if (!DatFileName.empty() || !path) + if (!path) continue; BasePath = path; for (const auto& datFileName : datFileNames) { auto fileName = datFileName; - auto found = false; for (int i = 0; i < 2; i++) { if (i == 1) @@ -164,19 +163,15 @@ void pb::SelectDatFile(const std::vector& dataSearchPaths) if (datFile) { fclose(datFile); - DatFileName = datFileName; + DatFileName = fileName; if (datFileName == "CADET.DAT") FullTiltMode = true; if (datFileName == "DEMO.DAT") FullTiltDemoMode = FullTiltMode = true; printf("Loading game from: %s\n", datFilePath.c_str()); - found = true; - break; + return; } } - - if (found) - break; } } }