Skip to content

Comments

Make sure to delete any dead objects in the Lab before processing#7223

Merged
BMagnu merged 1 commit intoscp-fs2open:masterfrom
MjnMixael:fix_lab_big_ship_death
Feb 24, 2026
Merged

Make sure to delete any dead objects in the Lab before processing#7223
BMagnu merged 1 commit intoscp-fs2open:masterfrom
MjnMixael:fix_lab_big_ship_death

Conversation

@MjnMixael
Copy link
Contributor

Fixes #6904

This one led me down a whole thing where I had to learn how ship splits happen and I'm still not entirely sure I found the root cause. What was happening here was that the Lab was calling ship_post_process() on a ship object that should be dead. The Lab already skips running this stuff on the current object if it's type is not OBJ_SHIP (it becomes OBJ_NONE when deleted in the object code). The assert in the bug wasn't always 100% consistent, though. Sometimes dead ship cleanup seemed to run correctly though I could never quite figure out under what circumstances it did not.

So while the root cause is somewhere in the path described above, I'm not sure it really matters because the Lab is one big hack anyway. So we really just need to make sure all objects marked for death are cleaned up each frame before we try to do any object processing and that's exactly what this PR does. While we're at it, whenever we change objects we clean up the ship splits in order to keep things tidy.

@wookieejedi wookieejedi added fix A fix for bugs, not-a-bugs, and/or regressions. Lab A feature or bug related to the F3 lab labels Feb 15, 2026
Copy link
Member

@wookieejedi wookieejedi left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me, though I will alas once again defer to @BMagnu

@BMagnu BMagnu merged commit 8e44f35 into scp-fs2open:master Feb 24, 2026
20 checks passed
@MjnMixael MjnMixael deleted the fix_lab_big_ship_death branch February 25, 2026 00:12
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. Lab A feature or bug related to the F3 lab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lab asserts when destroying a big ship after viewing a small ship

3 participants