Fix TriggerZoneQuadPoint forwarding heading into the parent's radius slot#435
Merged
Merged
Conversation
QuadPoint forwarded args to the parent positionally, so an explicit heading landed in the parent's radius slot (added by PR pydcs#254) and link_unit_id was lost. Forward by keyword and pass radius=0, the DCS-canonical value for quad zones.
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.
TriggerZoneQuadPoint.init forwards its arguments to the parent
TriggerZone.init positionally:
Since PR #254 re-added radius as the parent's 7th positional parameter
_id, position, hidden, name, color, properties, radius, heading, link_unit_id),
this call is now misaligned: heading lands in the radius slot, link_unit_id
lands in heading, and link_unit_id is dropped. A quad zone constructed with a
non-default heading serializes "radius": (and "radius": null at
defaults), whereas the DCS Mission Editor writes "radius": 0 for quad zones.
This isn't covered by #251/#243/#254 -- those fixed TriggerZoneCircular's
forwarding when radius was re-exposed but didn't update TriggerZoneQuadPoint,
so the gap went unnoticed. The existing test_create_quad_point_zone never threads
a heading/link_unit_id through the quad path, so it doesn't exercise this.
Fix: forward to the parent by keyword and pass radius=0 (the DCS-canonical value
for quad zones). Keyword forwarding also prevents this class of positional
regression from recurring.
Adds a round-trip test that constructs a quad zone with an explicit heading and
link_unit_id and asserts radius == 0 with both surviving the save/load.