diff --git a/src/Components/Modules/AssetHandler.cpp b/src/Components/Modules/AssetHandler.cpp index c8c72a7d..0be0660e 100644 --- a/src/Components/Modules/AssetHandler.cpp +++ b/src/Components/Modules/AssetHandler.cpp @@ -121,14 +121,6 @@ namespace Components { asset.material->sortKey = 0xE; } - -#ifdef DEBUG - // This is bad! We still want to see red-fxs in release mode - if (type == Game::XAssetType::ASSET_TYPE_XMODEL && name == "void") - { - asset.model->numLods = 0; - } -#endif } bool AssetHandler::IsAssetEligible(Game::XAssetType type, Game::XAssetHeader *asset) @@ -320,6 +312,8 @@ namespace Components AssetHandler::AssetHandler() { + Dvar::Register("r_noVoid", false, Game::DVAR_FLAG_SAVED, "Disable void model (red fx)"); + AssetHandler::ClearTemporaryAssets(); // DB_FindXAssetHeader @@ -348,6 +342,14 @@ namespace Components } }); + AssetHandler::OnLoad([] (Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool*) + { + if (Dvar::Var("r_noVoid").Get() && type == Game::XAssetType::ASSET_TYPE_XMODEL && name == "void") + { + asset.model->numLods = 0; + } + }); + // Register asset interfaces if (ZoneBuilder::IsEnabled()) {