Skip to content

Conversation

@Baezon
Copy link
Member

@Baezon Baezon commented Dec 9, 2025

Instead of searching for live debris, and then searching for that debris' parent, and then blowing them up, simply search for the submodels with live debris and blow them up directly. This simplifies the code and entirely skips needing and allows for the deletion of model_get_parent_submodel_for_live_debris which is good because it only handled submodels with live debris if they were a direct child of detail0, and would error if a ship with such a submodel were destroyed.

@Baezon Baezon added fix A fix for bugs, not-a-bugs, and/or regressions. Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle models Issues or features having to do with model data (like animations or geometry) labels Dec 9, 2025
Copy link
Contributor

@Goober5000 Goober5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good cleanup. 👍 One non-binding comment.

// if not blown off, blow it off
shipfx_subsystem_maybe_create_live_debris(ship_objp, shipp, pss, &exp_center, 3.0f);
ship_subsys* pss = nullptr;
for (pss = GET_FIRST(&shipp->subsys_list); pss != END_OF_LIST(&shipp->subsys_list); pss = GET_NEXT(pss)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use list_range here to make the loop a bit tidier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions. models Issues or features having to do with model data (like animations or geometry) Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants