Units::teleport: update occupancy for the full EQUIPMENT footprint - #5924
Open
Alistair-Afton wants to merge 1 commit into
Open
Alistair-Afton wants to merge 1 commit into
Alistair-Afton wants to merge 1 commit into
Conversation
EQUIPMENT units (wagons) occupy a 3x3 footprint centered on their position, but teleport only cleared and set the unit occupancy bits on the center tile. Teleported wagons left stale unit flags on the eight surrounding source tiles and arrived with none set on the destination footprint, leaving the map occupancy inconsistent until something recomputed it (issue DFHack#5797). The footprint extent now comes from the race's EQUIPMENT_WAGON flag, so ordinary units keep the existing single-tile behavior.
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.
Fixes #5797
Summary
Units::teleportonly cleared and set theunit/unit_groundedoccupancy bits on the unit's center tile. EQUIPMENT units such as wagons occupy a 3x3 footprint centered on their position, so a teleported wagon left stale flags on the eight surrounding source tiles and arrived with none set on the destination footprint.The footprint extent is now derived from the race's
EQUIPMENT_WAGONflag; ordinary units keep the existing single-tile behavior. The per-tile update logic is otherwise unchanged.Testing
Verified in a live fort against the rebuilt install by driving a synthetic wagon unit (race
EQUIPMENT_WAGON) throughdfhack.units.teleportand readingmap_block.occupancydirectly: