Skip to content

refactor CJumpNode to use SCP_vector#7432

Draft
Goober5000 wants to merge 2 commits intoscp-fs2open:masterfrom
Goober5000:claude/CJumpNode_vector
Draft

refactor CJumpNode to use SCP_vector#7432
Goober5000 wants to merge 2 commits intoscp-fs2open:masterfrom
Goober5000:claude/CJumpNode_vector

Conversation

@Goober5000
Copy link
Copy Markdown
Contributor

Jump nodes previously used SCP_list; refactor to use SCP_vector.

Follow-up to, and depends on, #7431. In draft pending sexp_tree changes.

@Goober5000 Goober5000 added the refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability label May 7, 2026
CJumpNode stored a private m_pos field that duplicated the position
already held by its Objects[] entry.  The field was set once during
construction and never updated afterward, so any subsequent movement
(e.g. FRED dragging) would leave m_pos stale while Objects[m_objnum].pos
held the authoritative value.  Every external caller already used
GetSCPObject()->pos instead; GetPosition() had zero call sites.

- Remove the m_pos field and its initialization in both constructors,
  the move constructor, and the move-assignment operator.
- Pass the constructor's position argument directly to obj_create()
  instead of routing through m_pos.
- Repoint GetPosition() at Objects[m_objnum].pos so it always returns
  the live, up-to-date position.
- Add GetRadius() to expose the cached m_radius, and use it in
  jumpnode_get_which_in() instead of the redundant model_get_radius()
  call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Goober5000 Goober5000 force-pushed the claude/CJumpNode_vector branch from 9090da8 to 3cffb57 Compare May 8, 2026 05:08
Jump nodes previously used SCP_list; refactor to use SCP_vector.

Follow-up to scp-fs2open#7431.
@Goober5000 Goober5000 force-pushed the claude/CJumpNode_vector branch from 3cffb57 to 543f1ef Compare May 8, 2026 06:04
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