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

Actually grab the object's type when doing type checks. #4505

Merged

Conversation

MageKing17
Copy link
Member

PR #4500 added some checks, but accidentally compared aip->target_objnum to an object type (although the assertion message correctly retrieved the object type, leading to the bizarre assertion that OBJ_SHIP, i.e. 1, was an invalid target object type). This commit makes them all access the Objects[] array and retrieve the .type, just as the assertion message does (and the pre-#4500 conditional did).

Related to #4504, in that it's the source of the failed assertions, although I can't be sure it was the cause of the crashes without testing.

PR scp-fs2open#4500 added some checks, but accidentally compared `aip->target_objnum` to an object type (although the assertion message correctly retrieved the object type, leading to the bizarre assertion that `OBJ_SHIP`, i.e. 1, was an invalid target object type). This commit makes them all access the `Objects[]` array and retrieve the `.type`, just as the assertion message does (and the pre-scp-fs2open#4500 conditional did).

Related to scp-fs2open#4504, in that it's the source of the failed assertions, although I can't be sure it was the cause of the crashes without testing.
@MageKing17 MageKing17 added the fix A fix for bugs, not-a-bugs, and/or regressions. label Jul 20, 2022
@MageKing17 MageKing17 added this to the Release 22.2 milestone Jul 20, 2022
@Baezon Baezon merged commit a16be86 into scp-fs2open:master Jul 21, 2022
@MageKing17 MageKing17 deleted the bugfix/actually-check-object-type branch July 21, 2022 07:11
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants