Don't always release custom assets

This commit is contained in:
Federico Cecchetto 2022-03-20 19:40:15 +01:00
parent 51d04f1cd3
commit 6b2cf9df0e

View File

@ -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<void>();
}
@ -30,7 +36,9 @@ namespace mods
{
scheduler::once([]()
{
release_assets = true;
game::Com_Shutdown("");
release_assets = false;
}, scheduler::pipeline::main);
}
}