mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-06 23:51:17 +00:00
Fixed crash in generate_parent_id()
This commit is contained in:
parent
9d8f8c64a7
commit
d824e77cf5
1 changed files with 4 additions and 0 deletions
|
@ -32,11 +32,15 @@ struct SpawnObjectData {
|
||||||
|
|
||||||
static u32 generate_parent_id(struct Object* objects[], u8 onIndex, bool sanitize) {
|
static u32 generate_parent_id(struct Object* objects[], u8 onIndex, bool sanitize) {
|
||||||
struct Object* o = objects[onIndex];
|
struct Object* o = objects[onIndex];
|
||||||
|
if (!o) { return (u32)-1; }
|
||||||
|
|
||||||
// special case if the parent is itself
|
// special case if the parent is itself
|
||||||
if (o->parentObj == o) { return (u32)-1; }
|
if (o->parentObj == o) { return (u32)-1; }
|
||||||
|
|
||||||
if (onIndex == 0) {
|
if (onIndex == 0) {
|
||||||
|
if (!o->parentObj) {
|
||||||
|
return (u32)-1;
|
||||||
|
}
|
||||||
if (sanitize && o->parentObj->oSyncID == 0) {
|
if (sanitize && o->parentObj->oSyncID == 0) {
|
||||||
return (u32)-1;
|
return (u32)-1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue