Skip to content

Commit a4c0a6e

Browse files
committed
Bugfix - Purge potentially invalid unknown data when changing shaders. (Was Causing errors with Face->Standard shader changes)
1 parent 45f2704 commit a4c0a6e

File tree

1 file changed

+16
-3
lines changed
  • xivModdingFramework/Materials/DataContainers

1 file changed

+16
-3
lines changed

xivModdingFramework/Materials/DataContainers/XivMtrl.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,20 @@ public void SetShaderInfo(ShaderInfo info, bool forced = false)
459459
ColorSetDataSize = 544;
460460
}
461461

462-
462+
463+
// Clear out the unknown lists back to known default working values.
464+
for(var idx = 0; idx < TexturePathUnknownList.Count; idx++)
465+
{
466+
TexturePathUnknownList[idx] = 0;
467+
}
468+
for (var idx = 0; idx < Unknown2.Length; idx++)
469+
{
470+
Unknown2[idx] = 0;
471+
}
472+
if (Unknown2.Length > 0)
473+
{
474+
Unknown2[0] = 12;
475+
}
463476
}
464477

465478
/// <summary>
@@ -777,8 +790,8 @@ private void RegenerateShaderParameterList(ShaderInfo info)
777790
}
778791
else if (info.Shader == MtrlShader.Standard || info.Shader == MtrlShader.Glass)
779792
{
780-
args.Add(MtrlShaderParameterId.Equipment1);
781-
args.Add(MtrlShaderParameterId.Reflection1);
793+
//args.Add(MtrlShaderParameterId.Equipment1);
794+
//args.Add(MtrlShaderParameterId.Reflection1);
782795
}
783796
else if (info.Shader == MtrlShader.Iris)
784797
{

0 commit comments

Comments
 (0)