diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 60d2976c..80f1129d 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -32,17 +32,20 @@ namespace Components std::string iwdName = Utils::String::VA("%s.iwd", this->mapname.data()); std::string path = Utils::String::VA("%s\\usermaps\\%s\\%s", Dvar::Var("fs_basepath").get(), this->mapname.data(), iwdName.data()); - this->searchPath.iwd = Game::FS_IsShippedIWD(path.data(), iwdName.data()); - - if (this->searchPath.iwd) + if (Utils::IO::FileExists(path)) { - this->searchPath.bLocalized = false; - this->searchPath.ignore = 0; - this->searchPath.ignorePureCheck = 0; - this->searchPath.language = 0; - this->searchPath.dir = nullptr; - this->searchPath.next = *Game::fs_searchpaths; - *Game::fs_searchpaths = &this->searchPath; + this->searchPath.iwd = Game::FS_IsShippedIWD(path.data(), iwdName.data()); + + if (this->searchPath.iwd) + { + this->searchPath.bLocalized = false; + this->searchPath.ignore = 0; + this->searchPath.ignorePureCheck = 0; + this->searchPath.language = 0; + this->searchPath.dir = nullptr; + this->searchPath.next = *Game::fs_searchpaths; + *Game::fs_searchpaths = &this->searchPath; + } } } }