Repository navigation
Resolve template tilesets in empty maps and nested layer groups - #87
Open
civilwarinfrance wants to merge 2 commits into
Open
civilwarinfrance wants to merge 2 commits into
civilwarinfrance wants to merge 2 commits into
Conversation
AI-assisted by Codex (GPT-6).
AI-assisted by Codex (GPT-6).
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.
Template-supplied tilesets currently fail in two map layouts: a map without its own tilesets raises
ValueErroron the first import, while objects inside layer groups skip import/remapping altogether and keep unresolved template-local GIDs. The latter can select a different tile from the map.Start the first imported tileset at GID 1 when needed, and visit nested layer groups when resolving template tile objects in both JSON and TMX parsers. Existing root-level allocation, shared-tileset reuse and map layer structure are preserved.
The integration test uses the existing templates with/without map tilesets and group depths 0, 1 and 3, checking GIDs, distinct imports, repeat reuse and image references. On the upstream base, 10 cases fail and 2 controls pass; all 12 pass with this fix. Full suite: 138 passed (96% coverage). Mypy passes 27 source files. Changed files pass Black; the new test passes Ruff. Repository-wide Ruff/Black findings match the original base (178 findings / six unrelated files). Tested on CPython 3.14/macOS ARM64.
AI assistance: implemented and tested with OpenAI Codex (GPT-6).