mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 01:29:21 +02:00
resourcemanager:[bug fix] directoryExists method should resolvePath before checking (#1102)
This commit is contained in:
parent
88d0ea34bf
commit
9c1f519f8a
@ -156,14 +156,13 @@ void ResourceManager::searchAndAddPackages(const std::string& packagesDir, const
|
|||||||
|
|
||||||
bool ResourceManager::fileExists(const std::string& fileName)
|
bool ResourceManager::fileExists(const std::string& fileName)
|
||||||
{
|
{
|
||||||
const std::string path = resolvePath(fileName);
|
return (PHYSFS_exists(resolvePath(fileName).c_str()) && !directoryExists(fileName));
|
||||||
return (PHYSFS_exists(path.c_str()) && !directoryExists(path));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceManager::directoryExists(const std::string& directoryName)
|
bool ResourceManager::directoryExists(const std::string& directoryName)
|
||||||
{
|
{
|
||||||
PHYSFS_Stat stat = {};
|
PHYSFS_Stat stat = {};
|
||||||
if (!PHYSFS_stat(directoryName.c_str(), &stat)) {
|
if (!PHYSFS_stat(resolvePath(directoryName).c_str(), &stat)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user