From c03268347a9164325da33b2099567f5307630b9a Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 9 Apr 2017 18:27:58 +0200 Subject: [PATCH] [Maps] Only load usermaps iwd if available --- src/Components/Modules/Maps.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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; + } } } }