From 359cb001e8a711e54c9d4f54cddefaceebd37908 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 10 Aug 2020 18:19:27 -0700 Subject: [PATCH] Synchronized blue coin switch --- src/game/behaviors/blue_coin.inc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/behaviors/blue_coin.inc.c b/src/game/behaviors/blue_coin.inc.c index 6f90fa5e..067dfbbf 100644 --- a/src/game/behaviors/blue_coin.inc.c +++ b/src/game/behaviors/blue_coin.inc.c @@ -60,6 +60,15 @@ void bhv_hidden_blue_coin_loop(void) { * Update function for bhvBlueCoinSwitch. */ void bhv_blue_coin_switch_loop(void) { + 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->oVelY); + network_init_object_field(o, &o->oGravity); + network_init_object_field(o, &o->oTimer); + network_init_object_field(o, &o->oPosY); + } + // The switch's model is 1/3 size. cur_obj_scale(3.0f); @@ -78,6 +87,7 @@ void bhv_blue_coin_switch_loop(void) { o->oGravity = 0.0f; cur_obj_play_sound_2(SOUND_GENERAL_SWITCH_DOOR_OPEN); + network_send_object(o); } }