Skip to content

Commit

Permalink
One extra condition in land/texmap selection
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Feb 22, 2024
1 parent 4aaa27c commit d9f988a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CentrED/Map/LandObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit d9f988a

Please sign in to comment.