Fix PostFx Materials blending for duplicated entries

#1991
This commit is contained in:
Wojtek Figat
2023-12-27 21:18:28 +01:00
parent b4c23c969a
commit b275ffc146

View File

@@ -207,13 +207,12 @@ void PostFxMaterialsSettings::BlendWith(PostFxMaterialsSettings& other, float we
if (isHalf)
{
int32 indexSrc = 0;
const auto materialsSrc = other.Materials.Get();
const AssetReference<MaterialBase>* materialsSrc = other.Materials.Get();
while (Materials.Count() != POST_PROCESS_SETTINGS_MAX_MATERIALS && indexSrc < other.Materials.Count())
{
if (materialsSrc[indexSrc])
{
Materials.Add(materialsSrc[indexSrc]);
}
MaterialBase* mat = materialsSrc[indexSrc].Get();
if (mat && !Materials.Contains(mat))
Materials.Add(mat);
indexSrc++;
}
}