Remove redundant m_pos from CJumpNode; add GetRadius() accessor#7431
Open
Goober5000 wants to merge 1 commit intoscp-fs2open:masterfrom
Open
Remove redundant m_pos from CJumpNode; add GetRadius() accessor#7431Goober5000 wants to merge 1 commit intoscp-fs2open:masterfrom
Goober5000 wants to merge 1 commit intoscp-fs2open:masterfrom
Conversation
8bce708 to
cf5c3b7
Compare
cf5c3b7 to
22d3bff
Compare
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>
22d3bff to
a644d94
Compare
Goober5000
added a commit
to Goober5000/fs2open.github.com
that referenced
this pull request
May 8, 2026
Jump nodes previously used SCP_list; refactor to use SCP_vector. Follow-up to scp-fs2open#7431.
Goober5000
added a commit
to Goober5000/fs2open.github.com
that referenced
this pull request
May 8, 2026
Jump nodes previously used SCP_list; refactor to use SCP_vector. Follow-up to scp-fs2open#7431.
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.
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.