From d9f988ae5bab97aff47092ce05c413b1fbcbc7f6 Mon Sep 17 00:00:00 2001 From: kaczy Date: Thu, 22 Feb 2024 13:53:11 +0100 Subject: [PATCH] One extra condition in land/texmap selection --- CentrED/Map/LandObject.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CentrED/Map/LandObject.cs b/CentrED/Map/LandObject.cs index 1da6384..98cba60 100644 --- a/CentrED/Map/LandObject.cs +++ b/CentrED/Map/LandObject.cs @@ -67,6 +67,7 @@ public void UpdateId(ushort newId) Rectangle bounds; var isStretched = !IsFlat(Vertices[0].Position.Z, Vertices[1].Position.Z, Vertices[2].Position.Z, Vertices[3].Position.Z); var isTexMapValid = TexmapsLoader.Instance.GetValidRefEntry(newId).Length > 0; + var isLandTileValid = ArtLoader.Instance.GetValidRefEntry(newId).Length > 0; if (isTexMapValid && !AlwaysFlat(newId)) { isStretched |= CalculateNormals(out var normals); @@ -75,7 +76,7 @@ public void UpdateId(ushort newId) Vertices[i].Normal = normals[i]; } } - var useTexMap = isTexMapValid && (Config.Instance.PreferTexMaps || isStretched); + var useTexMap = isTexMapValid && (Config.Instance.PreferTexMaps || isStretched || !isLandTileValid); if (useTexMap) { Texture = TexmapsLoader.Instance.GetLandTexture(TileDataLoader.Instance.LandData[newId].TexID, out bounds);