From d564a8dbcd2a7f5812725cb48058eec084af97fe Mon Sep 17 00:00:00 2001 From: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com> Date: Thu, 16 Apr 2026 10:44:33 -0500 Subject: [PATCH] Fix up compilation errors --- src/game/behaviors/flamethrower.inc.c | 2 +- src/game/behaviors/haunted_chair.inc.c | 4 +- src/game/behaviors/heave_ho.inc.c | 52 +++++++++++++++----------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/game/behaviors/flamethrower.inc.c b/src/game/behaviors/flamethrower.inc.c index 893791e66..40ae3608e 100644 --- a/src/game/behaviors/flamethrower.inc.c +++ b/src/game/behaviors/flamethrower.inc.c @@ -31,7 +31,7 @@ void bhv_flamethrower_flame_loop(void) { else { cur_obj_move_using_fvel_and_gravity(); } - if (o->oTimer > sp18) { + if (o->oTimer > remainingTime) { obj_mark_for_deletion(o); } o->oInteractStatus = 0; diff --git a/src/game/behaviors/haunted_chair.inc.c b/src/game/behaviors/haunted_chair.inc.c index 2d4c0a5c3..a3b86e3b0 100644 --- a/src/game/behaviors/haunted_chair.inc.c +++ b/src/game/behaviors/haunted_chair.inc.c @@ -87,8 +87,8 @@ void haunted_chair_act_0(void) { offset = -4.0f; } - o->oHomeX -= val08; - o->oHomeZ -= val08; + o->oHomeX -= offset; + o->oHomeZ -= offset; o->oFaceAnglePitch = o->oFaceAngleRoll = (s32)(50.0f * offset); } else { diff --git a/src/game/behaviors/heave_ho.inc.c b/src/game/behaviors/heave_ho.inc.c index e408126ad..1a1303e7e 100644 --- a/src/game/behaviors/heave_ho.inc.c +++ b/src/game/behaviors/heave_ho.inc.c @@ -4,10 +4,10 @@ s16 sHeaveHoTimings[][2] = { { 30, 0 }, { 42, 1 }, { 52, 0 }, { 64, 1 }, { 74, { 86, 1 }, { 96, 0 }, { 108, 1 }, { 118, 0 }, { -1, 0 }, }; void bhv_heave_ho_throw_mario_loop(void) { - struct MarioState* marioState = nearest_mario_state_to_object(o); + struct MarioState *marioState = nearest_mario_state_to_object(o); if (gMarioStates[0].heldByObj == o->parentObj) { marioState = &gMarioStates[0]; } - struct Object* player = marioState ? marioState->marioObj : NULL; + struct Object *player = marioState ? marioState->marioObj : NULL; o->oParentRelativePosX = 200.0f; o->oParentRelativePosY = -50.0f; o->oParentRelativePosZ = 0.0f; @@ -35,54 +35,57 @@ void bhv_heave_ho_throw_mario_loop(void) { } void heave_ho_act_1(void) { - s32 sp1C = 0; + s32 i = 0; o->oForwardVel = 0.0f; cur_obj_reverse_animation(); while (TRUE) { - if (sHeaveHoTimings[sp1C][0] == -1) { + if (sHeaveHoTimings[i][0] == -1) { o->oAction = 2; break; } - if (o->oTimer < sHeaveHoTimings[sp1C][0]) { - cur_obj_init_animation_with_accel_and_sound(2, sHeaveHoTimings[sp1C][1]); + if (o->oTimer < sHeaveHoTimings[i][0]) { + cur_obj_init_animation_with_accel_and_sound(2, sHeaveHoTimings[i][1]); break; } - sp1C++; + i++; } } void heave_ho_act_2(void) { - struct Object* player = nearest_player_to_object(o); + struct Object *player = nearest_player_to_object(o); s32 angleToPlayer = player ? obj_angle_to_object(o, player) : 0; - UNUSED s32 unused; - s16 angleVel; - if (1000.0f < cur_obj_lateral_dist_from_mario_to_home()) + if (1000.0f < cur_obj_lateral_dist_from_mario_to_home()) { angleToPlayer = cur_obj_angle_to_home(); + } + if (o->oTimer > 150) { o->oHeaveHoUnkF4 = (302 - o->oTimer) / 152.0f; if (o->oHeaveHoUnkF4 < 0.1) { o->oHeaveHoUnkF4 = 0.1; o->oAction = 1; } - } else + } else { o->oHeaveHoUnkF4 = 1.0f; + } cur_obj_init_animation_with_accel_and_sound(0, o->oHeaveHoUnkF4); o->oForwardVel = o->oHeaveHoUnkF4 * 10.0f; - angleVel = o->oHeaveHoUnkF4 * 0x400; + s16 angleVel = o->oHeaveHoUnkF4 * 0x400; o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, angleToPlayer, angleVel); } void heave_ho_act_3(void) { o->oForwardVel = 0.0f; - if (o->oTimer == 0) + if (o->oTimer == 0) { o->oHeaveHoUnk88 = 2; + } if (o->oTimer == 1) { cur_obj_init_animation_with_accel_and_sound(1, 1.0f); o->numCollidedObjs = 20; } - if (cur_obj_check_if_near_animation_end()) + if (cur_obj_check_if_near_animation_end()) { o->oAction = 1; + } } void heave_ho_act_0(void) { @@ -103,14 +106,17 @@ void heave_ho_move(void) { cur_obj_update_floor_and_walls(); CUR_OBJ_CALL_ACTION_FUNCTION(sHeaveHoActions); cur_obj_move_standard(-78); - if (o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) + if (o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) { o->oGraphYOffset = -15.0f; - else + } else { o->oGraphYOffset = 0.0f; - if (o->oForwardVel > 3.0f) + } + if (o->oForwardVel > 3.0f) { cur_obj_play_sound_1(SOUND_AIR_HEAVEHO_MOVE); - if (o->oAction != 0 && o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) + } + if (o->oAction != 0 && o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) { o->oAction = 0; + } if (o->oInteractStatus & INT_STATUS_GRABBED_MARIO) { o->oInteractStatus = 0; o->oHeaveHoUnk88 = 1; @@ -119,10 +125,10 @@ void heave_ho_move(void) { } } -void bhv_heave_ho_override_ownership(u8* shouldOverride, u8* shouldOwn) { +void bhv_heave_ho_override_ownership(u8 *shouldOverride, u8 *shouldOwn) { *shouldOverride = (gMarioStates[0].heldByObj == o); if (*shouldOverride) { - *shouldOwn = true; + *shouldOwn = TRUE; } } @@ -131,8 +137,10 @@ u8 bhv_heave_ho_ignore_if_true(void) { } void bhv_heave_ho_loop(void) { + // syncing uses a standard distance-based system that decides who owns the object via if mario + // is the held object or not. It relies on mario's held object being synced properly if (!sync_object_is_initialized(o->oSyncID)) { - struct SyncObject* so = sync_object_init(o, 4000.0f); + struct SyncObject *so = sync_object_init(o, 4000.0f); if (so != NULL) { so->override_ownership = bhv_heave_ho_override_ownership; so->ignore_if_true = bhv_heave_ho_ignore_if_true;