diff --git a/src/game/behaviors/sparkle_spawn_star.inc.c b/src/game/behaviors/sparkle_spawn_star.inc.c index 396b325f..3c14a494 100644 --- a/src/game/behaviors/sparkle_spawn_star.inc.c +++ b/src/game/behaviors/sparkle_spawn_star.inc.c @@ -80,6 +80,10 @@ void slow_star_rotation(void) { } void bhv_spawned_star_loop(void) { + if (!sync_object_is_initialized(o->oSyncID)) { + sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS); + } + if (o->oAction == 0) { // All of these are for checking if we spawned the star, If // we didn't. We don't need the time stop. @@ -140,6 +144,7 @@ void bhv_spawned_star_loop(void) { } else { set_sparkle_spawn_star_hitbox(); slow_star_rotation(); + network_send_object(o); } cur_obj_move_using_fvel_and_gravity(); o->oFaceAngleYaw += o->oAngleVelYaw; diff --git a/src/game/behaviors/spawn_star.inc.c b/src/game/behaviors/spawn_star.inc.c index 9bda024d..0ddcbb1e 100644 --- a/src/game/behaviors/spawn_star.inc.c +++ b/src/game/behaviors/spawn_star.inc.c @@ -106,6 +106,10 @@ void bhv_star_spawn_init(void) { } void bhv_star_spawn_loop(void) { + if (!sync_object_is_initialized(o->oSyncID)) { + sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS); + } + switch (o->oAction) { case 0: o->oFaceAngleYaw += 0x1000; @@ -148,6 +152,7 @@ void bhv_star_spawn_loop(void) { case 3: o->oFaceAngleYaw += 0x800; + cur_obj_become_tangible(); if (o->oTimer == 20) { gMarioStates[0].freeze = 0; gObjCutsceneDone = TRUE; @@ -159,6 +164,8 @@ void bhv_star_spawn_loop(void) { mark_obj_for_deletion(o); o->oInteractStatus = 0; } + + network_send_object(o); break; } spawn_star_number(); @@ -321,7 +328,7 @@ void bhv_hidden_red_coin_star_loop(void) { break; case 1: - if (o->oTimer == 3) { + if (o->oTimer > 2) { struct Object *obj = spawn_red_coin_cutscene_star(o->oPosX, o->oPosY, o->oPosZ); if (obj != NULL) { if (o->oHiddenStarLastInteractedObject == &gMarioStates[0]) { @@ -331,7 +338,7 @@ void bhv_hidden_red_coin_star_loop(void) { } spawn_mist_particles(); } - network_send_object(o); + o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } break; } diff --git a/src/game/obj_behaviors_2.c b/src/game/obj_behaviors_2.c index 602a7674..c54363e6 100644 --- a/src/game/obj_behaviors_2.c +++ b/src/game/obj_behaviors_2.c @@ -812,7 +812,7 @@ void obj_act_knockback(UNUSED f32 baseScale) { //! Dies immediately if above lava if ((o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_MASK_IN_WATER | OBJ_MOVE_HIT_WALL | OBJ_MOVE_ABOVE_LAVA)) - || (o->oAction == OBJ_ACT_VERTICAL_KNOCKBACK && o->oTimer >= 9)) { + || (o->oAction == OBJ_ACT_VERTICAL_KNOCKBACK && o->oTimer >= 9) || o->oSyncDeath) { obj_die_if_health_non_positive(); } @@ -832,7 +832,7 @@ void obj_act_squished(f32 baseScale) { if (approach_f32_ptr(&o->header.gfx.scale[1], targetScaleY, baseScale * 0.14f)) { o->header.gfx.scale[0] = o->header.gfx.scale[2] = baseScale * 2.0f - o->header.gfx.scale[1]; - if (o->oTimer >= 16) { + if (o->oTimer >= 16 || o->oSyncDeath) { obj_die_if_health_non_positive(); } } diff --git a/src/pc/network/packets/packet_object.c b/src/pc/network/packets/packet_object.c index 3178c8ee..8f8ead86 100644 --- a/src/pc/network/packets/packet_object.c +++ b/src/pc/network/packets/packet_object.c @@ -419,6 +419,7 @@ void network_receive_object(struct Packet* p) { // deactivated if (o->activeFlags == ACTIVE_FLAG_DEACTIVATED) { + o->oSyncDeath = 1; // Force oSyncDeath if deactivated sync_object_forget(so->id); } else if (p->reliable) { // remember packet