Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert: "tree_index >= 0" after #1630 when model with $nocollide_this_only explodes #1708

Closed
tomimaki opened this issue Apr 19, 2018 · 3 comments · Fixed by #1733
Closed

Comments

@tomimaki
Copy link
Contributor

Release build gives me multiple times
nocollide
and debug build: ASSERTION: "tree_index >= 0" at modelread.cpp:5232
fs2_open.log

Example is Shivan Commnode from Mediavps 2014. Load mission Into Lion's Den (loop2-2.fs2), pack Trebuchet, destroy Crystal in Commnode and wait until it explode.

Another example is Vishnan_Protector from BP but can't find reliable mission.

@ngld
Copy link
Contributor

ngld commented Apr 19, 2018

The debug assertion is caused by the fact that submodel_get_two_random_points_better assumes that detail0 always has a collision tree. If the tree hasn't been loaded, the tree_index is -1 which then causes that assertion in model_get_bsp_collision_tree.

A nice solution would be to make submodel_get_two_random_points_better use a collide subobject if one is available instead of detail0 but I don't know enough about the code to do this myself.

Goober5000 pushed a commit to Goober5000/fs2open.github.com that referenced this issue May 29, 2018
@Goober5000
Copy link
Contributor

I don't know about collision subobjects myself, but it's a simple matter to fall back to the old method, so I made a new PR to do just that.

@tomimaki
Copy link
Contributor Author

I can confirm that #1733 fixed issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants