From 315630bb762968fdf6336a3b4687de7484731e8a Mon Sep 17 00:00:00 2001 From: m Date: Sat, 3 Sep 2022 05:25:13 -0500 Subject: [PATCH] tiny changes --- src/client/component/command.cpp | 8 ++------ src/client/component/fastfiles.cpp | 10 +++++++--- src/client/component/mods.cpp | 2 +- src/client/component/ui_scripting.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index f003187d..e01ce5fd 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -110,10 +110,8 @@ namespace command void register_fs_game_path() { - console::debug("[FS] " __FUNCTION__ " called\n"); - static const auto* fs_game = game::Dvar_FindVar("fs_game"); - const auto* new_mod_path = fs_game->current.string; + const auto new_mod_path = fs_game->current.string; // check if the last saved fs_game value isn't empty and if it doesn't equal the new fs_game if (!saved_fs_game.empty() && saved_fs_game != new_mod_path) @@ -124,12 +122,9 @@ namespace command if (new_mod_path && !new_mod_path[0]) { - console::debug("[FS] " __FUNCTION__ " returning because new mod path is blank\n"); return; } - console::debug("[FS] " __FUNCTION__ " registering new mod path\n"); - // register fs_game value as a fs directory used for many things filesystem::register_path(new_mod_path); saved_fs_game = new_mod_path; @@ -597,6 +592,7 @@ namespace command dvars::callback::on_new_value("fs_game", []() { + console::warn("fs_game value changed, filesystem paths will be adjusted to new dvar value."); register_fs_game_path(); }); diff --git a/src/client/component/fastfiles.cpp b/src/client/component/fastfiles.cpp index 58216ee2..96f4a06c 100644 --- a/src/client/component/fastfiles.cpp +++ b/src/client/component/fastfiles.cpp @@ -172,8 +172,8 @@ namespace fastfiles utils::hook::detour sys_createfile_hook; HANDLE sys_create_file_stub(game::Sys_Folder folder, const char* base_filename) { - auto* fs_basepath = game::Dvar_FindVar("fs_basepath"); - auto* fs_game = game::Dvar_FindVar("fs_game"); + static const auto* fs_basepath = game::Dvar_FindVar("fs_basepath"); + static const auto* fs_game = game::Dvar_FindVar("fs_game"); std::string dir = fs_basepath ? fs_basepath->current.string : ""; std::string mod_dir = fs_game ? fs_game->current.string : ""; @@ -232,8 +232,12 @@ namespace fastfiles // ui // common + //try_load_zone("h1_mod_common", true); + game::DB_LoadXAssets(data.data(), static_cast(data.size()), syncMode); + // H2-mod has the try_load_zone for mod right here but before, we had it before the load assets call. guess quaK can let me know + // what to do about this try_load_zone("mod", true); } @@ -335,7 +339,7 @@ namespace fastfiles } const auto name = params.get(1); - if (!try_load_zone(name, false)) + if (!try_load_zone(name, false, true)) { console::warn("loadzone: zone \"%s\" could not be found!\n", name); } diff --git a/src/client/component/mods.cpp b/src/client/component/mods.cpp index e4b1b723..a8dcb953 100644 --- a/src/client/component/mods.cpp +++ b/src/client/component/mods.cpp @@ -149,7 +149,7 @@ namespace mods command::add("com_restart", []() { - if (!game::Com_InFrontend()) + if (!game::Com_InFrontend() && (game::environment::is_mp() && !game::VirtualLobby_Loaded())) { return; } diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index ac566a2e..31172293 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -219,7 +219,7 @@ namespace ui_scripting game_type["addlocalizedstring"] = [](const game&, const std::string& string, const std::string& value) { - localized_strings::override(string, value); + localized_strings::override(string, value, true); }; game_type["sharedset"] = [](const game&, const std::string& key, const std::string& value)