Fix up compilation errors

This commit is contained in:
EmeraldLockdown 2026-04-16 10:44:33 -05:00
parent d09ecb553a
commit d564a8dbcd
3 changed files with 33 additions and 25 deletions

View file

@ -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;

View file

@ -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 {

View file

@ -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;