[AssetHandler] Don't display missing techset errors for dedis

This commit is contained in:
momo5502 2017-06-04 16:53:29 +02:00
parent 8d020f160a
commit f0db0f2114
2 changed files with 11 additions and 0 deletions

View File

@ -399,6 +399,12 @@ namespace Components
}
}
void AssetHandler::MissingAssetError(int severity, const char* format, const char* type, const char* name)
{
if(Dedicated::IsEnabled() && Game::DB_GetXAssetNameType(type) == Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET) return;
Utils::Hook::Call<void(int, const char*, const char*, const char*)>(0x4F8C70)(severity, format, type, name); // Print error
}
AssetHandler::AssetHandler()
{
Dvar::Register<bool>("r_noVoid", false, Game::DVAR_FLAG_SAVED, "Disable void model (red fx)");
@ -417,6 +423,9 @@ namespace Components
// Store empty assets
Utils::Hook(0x5BB6EC, AssetHandler::StoreEmptyAssetStub, HOOK_CALL).install()->quick();
// Intercept missing asset messages
Utils::Hook(0x5BB3F2, AssetHandler::MissingAssetError, HOOK_CALL).install()->quick();
// Log missing empty assets
Scheduler::OnFrame([] ()
{

View File

@ -68,6 +68,8 @@ namespace Components
static int HasThreadBypass();
static void SetBypassState(bool value);
static void MissingAssetError(int severity, const char* format, const char* type, const char* name);
};
}