Make sure to delete any dead objects in the Lab before processing#7223
Open
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
Open
Make sure to delete any dead objects in the Lab before processing#7223MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
Conversation
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.
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.