Fix LandBrush Manager crash on missing texmaps; fall back to land art#80
Open
thefrsx wants to merge 1 commit into
Open
Fix LandBrush Manager crash on missing texmaps; fall back to land art#80thefrsx wants to merge 1 commit into
thefrsx wants to merge 1 commit into
Conversation
CalculateButtonTexture dereferenced a null Texture when both the tile's texmap and the 0x0001 VOID fallback were absent (e.g. art sets shipped without texmaps). This threw a NullReferenceException in DrawTransitions, crashing the app when selecting a brush in the LandBrush Manager. Guard the null texture, and in both DrawTile and CalculateButtonTexture fall back to the flat land art (Arts.GetLand) exactly as TilesWindow does, so brush and transition previews render even when texmaps are unavailable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening Tool → LandBrush Manager and selecting a brush crashes the app:
CalculateButtonTexturefalls back to the0x0001VOID texmap when a tile's texmap is missing, but if that fallback is also absent (art sets that ship without texmaps),spriteInfo.Textureisnullandtex.Widththrows.DrawTransitionshas no try/catch, so the whole app goes down. Hit this on a shard whosetexidx.mulhad no valid entries.Fix
CalculateButtonTexture(return an empty texture ref instead of dereferencing null).DrawTileandCalculateButtonTexture, fall back to the flat land art viaArts.GetLand(...), the same wayTilesWindowresolves land previews — so brush/transition thumbnails still render when texmaps are unavailable.No behavior change when texmaps are present.