refactor CJumpNode to use SCP_vector#7432
Draft
Goober5000 wants to merge 2 commits intoscp-fs2open:masterfrom
Draft
refactor CJumpNode to use SCP_vector#7432Goober5000 wants to merge 2 commits intoscp-fs2open:masterfrom
Goober5000 wants to merge 2 commits intoscp-fs2open:masterfrom
Conversation
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>
9090da8 to
3cffb57
Compare
Jump nodes previously used SCP_list; refactor to use SCP_vector. Follow-up to scp-fs2open#7431.
3cffb57 to
543f1ef
Compare
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.
Jump nodes previously used SCP_list; refactor to use SCP_vector.
Follow-up to, and depends on, #7431. In draft pending sexp_tree changes.