Skip to content

Commit

Permalink
Fix crash when drawing transition if one side doesn't have texture
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Oct 9, 2024
1 parent 85a0e81 commit 28b354d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CentrED/UI/Windows/LandBrushManagerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ private void ToggleDirButton(LandBrushTransition transition, Direction dir, (nin
private (nint texPtr, Vector2 uv0, Vector2 uv1) CalculateButtonTexture(ushort tileId)
{
var spriteInfo = CEDGame.MapManager.Texmaps.GetTexmap(TileDataLoader.Instance.LandData[tileId].TexID);
if (spriteInfo.Texture == null)
{
//Fallback to VOID
spriteInfo = CEDGame.MapManager.Texmaps.GetTexmap(0x0001);
}
var tex = spriteInfo.Texture;
var bounds = spriteInfo.UV;
var texPtr = CEDGame.UIManager._uiRenderer.BindTexture(tex);
Expand Down

0 comments on commit 28b354d

Please sign in to comment.