[Maps] Only load usermaps iwd if available

This commit is contained in:
momo5502 2017-04-09 18:27:58 +02:00
parent 75d202e2b9
commit c03268347a

View File

@ -32,17 +32,20 @@ namespace Components
std::string iwdName = Utils::String::VA("%s.iwd", this->mapname.data()); 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<const char*>(), this->mapname.data(), iwdName.data()); std::string path = Utils::String::VA("%s\\usermaps\\%s\\%s", Dvar::Var("fs_basepath").get<const char*>(), this->mapname.data(), iwdName.data());
this->searchPath.iwd = Game::FS_IsShippedIWD(path.data(), iwdName.data()); if (Utils::IO::FileExists(path))
if (this->searchPath.iwd)
{ {
this->searchPath.bLocalized = false; this->searchPath.iwd = Game::FS_IsShippedIWD(path.data(), iwdName.data());
this->searchPath.ignore = 0;
this->searchPath.ignorePureCheck = 0; if (this->searchPath.iwd)
this->searchPath.language = 0; {
this->searchPath.dir = nullptr; this->searchPath.bLocalized = false;
this->searchPath.next = *Game::fs_searchpaths; this->searchPath.ignore = 0;
*Game::fs_searchpaths = &this->searchPath; this->searchPath.ignorePureCheck = 0;
this->searchPath.language = 0;
this->searchPath.dir = nullptr;
this->searchPath.next = *Game::fs_searchpaths;
*Game::fs_searchpaths = &this->searchPath;
}
} }
} }
} }