From 6b2cf9df0e3ac368cc6601ab3dc133c140aa93e6 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 20 Mar 2022 19:40:15 +0100 Subject: [PATCH] Don't always release custom assets --- src/client/component/mods.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/component/mods.cpp b/src/client/component/mods.cpp index ae78b9e7..117cd3e7 100644 --- a/src/client/component/mods.cpp +++ b/src/client/component/mods.cpp @@ -19,10 +19,16 @@ namespace mods { utils::hook::detour db_release_xassets_hook; + bool release_assets = false; + void db_release_xassets_stub() { - materials::clear(); - fonts::clear(); + if (release_assets) + { + materials::clear(); + fonts::clear(); + } + db_release_xassets_hook.invoke(); } @@ -30,7 +36,9 @@ namespace mods { scheduler::once([]() { + release_assets = true; game::Com_Shutdown(""); + release_assets = false; }, scheduler::pipeline::main); } }