[IMaterial] Fix mapping for effect techsets

This commit is contained in:
momo5502 2017-04-20 21:52:50 +02:00
parent 53e86b179b
commit ef882ff398

View File

@ -58,9 +58,17 @@ namespace Assets
if (!asset->techniqueSet) if (!asset->techniqueSet)
{ {
// Workaround for effect techsets having _nofog suffix
std::string suffix;
if(Utils::String::StartsWith(techset, "effect_") && Utils::String::EndsWith(techset, "_nofog"))
{
suffix = "_nofog";
Utils::String::Replace(techset, suffix, "");
}
for (int i = 0; i < ARRAYSIZE(techsetSuffix); ++i) for (int i = 0; i < ARRAYSIZE(techsetSuffix); ++i)
{ {
Game::MaterialTechniqueSet* techsetPtr = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, (techset + techsetSuffix[i]).data(), builder).techniqueSet; Game::MaterialTechniqueSet* techsetPtr = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, (techset + techsetSuffix[i] + suffix).data(), builder).techniqueSet;
if (techsetPtr) if (techsetPtr)
{ {