From 089d3c9180fa5ad7e9986fe261b77c110e69947e Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 5 Sep 2021 17:04:35 +0200 Subject: [PATCH] Swap FontIcon finding method from DB_FindXAssetHeader to DB_FindXAssetEntry --- src/Components/Modules/TextRenderer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/TextRenderer.cpp b/src/Components/Modules/TextRenderer.cpp index d50d1916..985eebef 100644 --- a/src/Components/Modules/TextRenderer.cpp +++ b/src/Components/Modules/TextRenderer.cpp @@ -146,10 +146,11 @@ namespace Components const std::string fontIconName(text, curPos - text); - auto* material = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, fontIconName.data()).material; - if (material == nullptr || material->techniqueSet == nullptr || material->techniqueSet->name == nullptr || strcmp(material->techniqueSet->name, "2d") != 0) + auto* materialEntry = Game::DB_FindXAssetEntry(Game::XAssetType::ASSET_TYPE_MATERIAL, fontIconName.data()); + if (materialEntry == nullptr) return false; - if (Game::DB_IsXAssetDefault(Game::ASSET_TYPE_MATERIAL, material->info.name)) + auto* material = materialEntry->asset.header.material; + if (material == nullptr || material->techniqueSet == nullptr || material->techniqueSet->name == nullptr || strcmp(material->techniqueSet->name, "2d") != 0) return false; text = curPos + 1;