From 9c1f519f8a5629620c96800dfc6bec733d968e09 Mon Sep 17 00:00:00 2001 From: vfjpl Date: Sat, 29 Aug 2020 17:35:42 +0200 Subject: [PATCH] resourcemanager:[bug fix] directoryExists method should resolvePath before checking (#1102) --- src/framework/core/resourcemanager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/framework/core/resourcemanager.cpp b/src/framework/core/resourcemanager.cpp index 15e49d35..6d0a21ee 100644 --- a/src/framework/core/resourcemanager.cpp +++ b/src/framework/core/resourcemanager.cpp @@ -156,14 +156,13 @@ void ResourceManager::searchAndAddPackages(const std::string& packagesDir, const bool ResourceManager::fileExists(const std::string& fileName) { - const std::string path = resolvePath(fileName); - return (PHYSFS_exists(path.c_str()) && !directoryExists(path)); + return (PHYSFS_exists(resolvePath(fileName).c_str()) && !directoryExists(fileName)); } bool ResourceManager::directoryExists(const std::string& directoryName) { PHYSFS_Stat stat = {}; - if (!PHYSFS_stat(directoryName.c_str(), &stat)) { + if (!PHYSFS_stat(resolvePath(directoryName).c_str(), &stat)) { return false; }