From 254486a39f2edb605128c66fab791e796e0d792c Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 13 Apr 2022 01:30:53 -0700 Subject: [PATCH] Fixed crash in haunted bookshelf manager --- src/game/behaviors/flying_bookend_switch.inc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/flying_bookend_switch.inc.c b/src/game/behaviors/flying_bookend_switch.inc.c index 21327c0a..ceaa36f8 100644 --- a/src/game/behaviors/flying_bookend_switch.inc.c +++ b/src/game/behaviors/flying_bookend_switch.inc.c @@ -230,12 +230,13 @@ void bookshelf_manager_act_3(void) { if (o->parentObj == NULL || o->parentObj->behavior != bhvHauntedBookshelf) { o->parentObj = cur_obj_nearest_object_with_behavior(bhvHauntedBookshelf); } + if (o->oTimer > 85) { if (o->oSyncID != 0 && gSyncObjects[o->oSyncID].owned) { o->oAction = 4; network_send_object(o); } - } else { + } else if (o->parentObj != NULL) { o->oForwardVel = o->parentObj->oPosX - o->oPosX; o->oPosX = o->parentObj->oPosX; }