diff --git a/src/game/behaviors/bomp.inc.c b/src/game/behaviors/bomp.inc.c index 26b38931..29ca5fd1 100644 --- a/src/game/behaviors/bomp.inc.c +++ b/src/game/behaviors/bomp.inc.c @@ -4,6 +4,14 @@ void bhv_small_bomp_init(void) { o->oFaceAngleYaw -= 0x4000; o->oSmallBompInitX = o->oPosX; o->oTimer = random_float() * 100.0f; + if (o->oSyncID == 0) { + network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS); + network_init_object_field(o, &o->oAction); + network_init_object_field(o, &o->oForwardVel); + network_init_object_field(o, &o->oMoveAngleYaw); + network_init_object_field(o, &o->oPosX); + network_init_object_field(o, &o->oTimer); + } } void bhv_small_bomp_loop(void) { @@ -34,11 +42,13 @@ void bhv_small_bomp_loop(void) { o->oForwardVel = 0; } - if (o->oTimer == 60) { + if (o->oTimer >= 60) { + if (o->oTimer == 60) { cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2); } + if (!network_owns_object(o)) { break; } o->oAction = BOMP_ACT_RETRACT; o->oForwardVel = 10.0f; o->oMoveAngleYaw -= 0x8000; - cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2); + network_send_object(o); } break; @@ -60,6 +70,14 @@ void bhv_small_bomp_loop(void) { void bhv_large_bomp_init(void) { o->oMoveAngleYaw += 0x4000; o->oTimer = random_float() * 100.0f; + if (o->oSyncID == 0) { + network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS); + network_init_object_field(o, &o->oAction); + network_init_object_field(o, &o->oForwardVel); + network_init_object_field(o, &o->oMoveAngleYaw); + network_init_object_field(o, &o->oPosX); + network_init_object_field(o, &o->oTimer); + } } void bhv_large_bomp_loop(void) { @@ -90,11 +108,13 @@ void bhv_large_bomp_loop(void) { o->oForwardVel = 0; } - if (o->oTimer == 60) { + if (o->oTimer >= 60) { + if (o->oTimer == 60) { cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2); } + if (!network_owns_object(o)) { break; } o->oAction = BOMP_ACT_RETRACT; o->oForwardVel = 10.0f; o->oMoveAngleYaw -= 0x8000; - cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2); + network_send_object(o); } break;