From 1c52a7bb4717f29260ca7deeb03bcd73e26479cb Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 22 Dec 2022 03:20:32 +0300 Subject: [PATCH] Add localized zone loading (mp) (#421) --- src/client/component/fastfiles.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/client/component/fastfiles.cpp b/src/client/component/fastfiles.cpp index cfd984f1..a85bfb8b 100644 --- a/src/client/component/fastfiles.cpp +++ b/src/client/component/fastfiles.cpp @@ -167,6 +167,10 @@ namespace fastfiles { const auto language = game::SEH_GetCurrentLanguageCode(); try_load_zone(language + "_"s + name, false); + if (game::environment::is_mp()) + { + try_load_zone(language + "_"s + name + "_mp"s, false); + } } if (!fastfiles::exists(name)) @@ -256,7 +260,7 @@ namespace fastfiles { if (!mod_dir.empty()) { - const auto path = utils::string::va("%s\\%s\\%s", + const auto path = utils::string::va("%s\\%s\\%s", dir.data(), mod_dir.data(), base_filename); if (utils::io::file_exists(path)) @@ -309,7 +313,7 @@ namespace fastfiles return fastfiles::usermap_exists(file); } - template + template inline void merge(std::vector* target, T* source, size_t length) { if (source) @@ -321,7 +325,7 @@ namespace fastfiles } } - template + template inline void merge(std::vector* target, std::vector source) { for (auto& entry : source) @@ -450,7 +454,7 @@ namespace fastfiles }); } - void enum_assets(const game::XAssetType type, + void enum_assets(const game::XAssetType type, const std::function& callback, const bool includeOverride) { game::DB_EnumXAssets_Internal(type, static_cast([](game::XAssetHeader header, void* data) @@ -524,7 +528,7 @@ namespace fastfiles { utils::hook::nop(0x368153_b, 2); // DB_InflateInit } - + if (game::environment::is_sp()) { // Allow loading mp maps