From 938e0a817eea410593476ceda7011fcdd8da811a Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 6 Oct 2020 20:27:12 -0700 Subject: [PATCH] Synchronized WDW arrow lift --- src/game/behaviors/arrow_lift.inc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/arrow_lift.inc.c b/src/game/behaviors/arrow_lift.inc.c index 127d3576..8e1bd2bd 100644 --- a/src/game/behaviors/arrow_lift.inc.c +++ b/src/game/behaviors/arrow_lift.inc.c @@ -59,12 +59,20 @@ static s8 arrow_lift_move_back(void) { * Arrow lift update function. */ void bhv_arrow_lift_loop(void) { + if (!network_sync_object_initialized(o)) { + network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS); + network_init_object_field(o, &o->oTimer); + network_init_object_field(o, &o->oPrevAction); + network_init_object_field(o, &o->oAction); + } + switch (o->oAction) { case ARROW_LIFT_ACT_IDLE: // Wait 61 frames before moving. if (o->oTimer > 60) { - if (gMarioObject->platform == o) { + if (cur_obj_is_any_player_on_platform()) { o->oAction = ARROW_LIFT_ACT_MOVING_AWAY; + network_send_object(o); } }