Skip to content

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

Open
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
MjnMixael:fix_lab_big_ship_death
Open

Make sure to delete any dead objects in the Lab before processing#7223
MjnMixael wants to merge 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
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

2 participants