Repository navigation
bugfix(worldbuilder): Keep new and resized maps within the map size limit - #3501
tintinhamans wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughBoth WorldBuilder variants add shared map-size validation. The check is used when constructing or resizing maps, submitting new-map dimensions, and applying configured defaults. Resizing also changes height-data allocation and array handling. ChangesHeight-map validation
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
ba592df to
e9975d0
Compare
[Medium impact] The PR appears safe to merge.
|
|
As WWB2 mentioned in the other PR, we might want to limit the map Area rather than hard limit dimensions, since it's the overall area that causes problems and not just individual dimensions. So the Max area being 4096 squared etc |
e9975d0 to
679d8f2
Compare
The limit is now an area of 4096x4096. Each side is still capped at 8192 because shoreline tiles pack coordinates into 16 bits and the shroud texture spans the map. |
679d8f2 to
e1712e5
Compare
df25ef5 to
c12b922
Compare
c12b922 to
a72fd31
Compare
|
Needs rebase? |
a72fd31 to
17859d5
Compare
The new map and resize dialog accepts any size, so WorldBuilder could create and save maps the loader rejects.
isValidMapSizenow appliesMAX_MAP_DIMENSIONandMAX_MAP_AREAto the map plus its border in the dialog,resizeand the saved defaults, and the dialog warns above 1024x1024.resizealso frees its arrays withdelete[]and clears the new flip and cliff state.