From 4d997ba05ef2477827660ebefde70737795e29b0 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 2 Aug 2021 19:45:13 -0700 Subject: [PATCH] Fix long-standing chair crash in BBH --- src/game/behaviors/haunted_chair.inc.c | 1 - src/game/obj_behaviors_2.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/behaviors/haunted_chair.inc.c b/src/game/behaviors/haunted_chair.inc.c index e1779ad7..c5c3fe34 100644 --- a/src/game/behaviors/haunted_chair.inc.c +++ b/src/game/behaviors/haunted_chair.inc.c @@ -27,7 +27,6 @@ void bhv_haunted_chair_init(void) { network_init_object_field(o, &o->oFaceAnglePitch); network_init_object_field(o, &o->oFaceAngleRoll); network_init_object_field(o, &o->oFaceAngleYaw); - network_init_object_field(o, &o->oHauntedChairUnk100); network_init_object_field(o, &o->oHauntedChairUnk104); network_init_object_field(o, &o->oHauntedChairUnkF4); network_init_object_field(o, &o->oHauntedChairUnkF8); diff --git a/src/game/obj_behaviors_2.c b/src/game/obj_behaviors_2.c index 82c000a7..bed2e7a8 100644 --- a/src/game/obj_behaviors_2.c +++ b/src/game/obj_behaviors_2.c @@ -511,6 +511,7 @@ static s32 obj_grow_then_shrink(f32 *scaleVel, f32 shootFireScale, f32 endScale) static s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero, f32 accel, f32 slowdown) { + if (value == NULL || vel == NULL) { return FALSE; } s32 startValue = *value; *value += (s32) *vel;