Skip to content

give props, waypoint lists, jump nodes, and waypoints the full slot treatment - #7715

Open
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:refactor/entity_reorder_machinery
Open

give props, waypoint lists, jump nodes, and waypoints the full slot treatment#7715
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:refactor/entity_reorder_machinery

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

Extend the reassign/swap/rotate slot machinery (now in missioneditor/slot_operations) to props, waypoint lists, and jump nodes, following the ship/wing precedent. A new SlotOps bundle lets vector-backed types acquire the temporary parking slot by appending an empty element and shrinking. All reorder operations now restore the obj_used_list subset-order invariant, where previously only ships and props did.

Also promote individual-waypoint move/swap into shared code: waypoints are referenced positionally in SEXPs and AI goals (listname:N), so reordering within a list must rename every affected reference via temporary names. Keeping that logic next to the other reorder machinery disarms the trap for any future editor UI that reorders waypoints. This also fixes a live bug: the editors track cur_waypoint/cur_waypoint_list as raw pointers into vectors that reordering shuffles (and now may reallocate), so a waypoint-list reorder left them pointing at the wrong list.

Along the way, dedup the editor-level ai_update_goal_references() (identical in FRED2 and qtFRED) into common, and add array manipulation utilities to code/utils/array_utils.h for general use.

@Goober5000 Goober5000 added the refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability label Aug 17, 2026
@Goober5000
Goober5000 force-pushed the refactor/entity_reorder_machinery branch 4 times, most recently from 1155848 to e26278a Compare August 17, 2026 02:16
…reatment

Extend the reassign/swap/rotate slot machinery (now in missioneditor/slot_operations) to props, waypoint lists, and jump nodes, following the ship/wing precedent.  A new SlotOps bundle lets vector-backed types acquire the temporary parking slot by appending an empty element and shrinking.  All reorder operations now restore the obj_used_list subset-order invariant, where previously only ships and props did.

Also promote individual-waypoint move/swap into shared code: waypoints are referenced positionally in SEXPs and AI goals (listname:N), so reordering within a list must rename every affected reference via temporary names.  Keeping that logic next to the other reorder machinery disarms the trap for any future editor UI that reorders waypoints.  This also fixes a live bug: the editors track cur_waypoint/cur_waypoint_list as raw pointers into vectors that reordering shuffles (and now may reallocate), so a waypoint-list reorder left them pointing at the wrong list.

Along the way, dedup the editor-level ai_update_goal_references() (identical in FRED2 and qtFRED) into common, and add array manipulation utilities to code/utils/array_utils.h for general use.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Goober5000
Goober5000 force-pushed the refactor/entity_reorder_machinery branch from e26278a to f338471 Compare August 17, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant