Some fixes

This commit is contained in:
momo5502 2016-06-24 18:48:04 +02:00
parent 545d6458c8
commit 75dda8062a
2 changed files with 14 additions and 6 deletions

View File

@ -99,13 +99,13 @@ namespace Components
void FileSystem::RegisterFolder(const char* folder)
{
const char* fs_cdpath = Dvar::Var("fs_cdpath").Get<const char*>();
const char* fs_basepath = Dvar::Var("fs_basepath").Get<const char*>();
const char* fs_homepath = Dvar::Var("fs_homepath").Get<const char*>();
std::string fs_cdpath = Dvar::Var("fs_cdpath").Get<std::string>();
std::string fs_basepath = Dvar::Var("fs_basepath").Get<std::string>();
std::string fs_homepath = Dvar::Var("fs_homepath").Get<std::string>();
if (fs_cdpath) Game::FS_AddLocalizedGameDirectory(fs_cdpath, folder);
if (fs_basepath) Game::FS_AddLocalizedGameDirectory(fs_basepath, folder);
if (fs_homepath) Game::FS_AddLocalizedGameDirectory(fs_homepath, folder);
if (!fs_cdpath.empty()) Game::FS_AddLocalizedGameDirectory(fs_cdpath.data(), folder);
if (!fs_basepath.empty()) Game::FS_AddLocalizedGameDirectory(fs_basepath.data(), folder);
if (!fs_homepath.empty()) Game::FS_AddLocalizedGameDirectory(fs_homepath.data(), folder);
}
void FileSystem::RegisterFolders()

View File

@ -551,6 +551,14 @@ namespace Components
AssetHandler::FindOriginalAsset(Game::XAssetType::ASSET_TYPE_RAWFILE, zone.data()); // Lock until zone is loaded
auto assets = ZoneBuilder::EndAssetTrace();
Logger::Print("Unloading zone '%s'...\n", zone.data());
info.freeFlags = info.allocFlags;
info.allocFlags = 0;
info.name = nullptr;
Game::DB_LoadXAssets(&info, 1, true);
AssetHandler::FindOriginalAsset(Game::XAssetType::ASSET_TYPE_RAWFILE, "default"); // Lock until zone is unloaded
Logger::Print("Zone '%s' loaded with %d assets:\n", zone.data(), assets.size());