From 8fb46314fa770d8b14c51760f4cff68e8eeca790 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 5 Sep 2021 14:42:53 -0700 Subject: [PATCH] Resync bouncing fireball to only have one owner --- src/game/behaviors/bouncing_fireball.inc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/bouncing_fireball.inc.c b/src/game/behaviors/bouncing_fireball.inc.c index 9df5b0ec5..4c0ed1d8a 100644 --- a/src/game/behaviors/bouncing_fireball.inc.c +++ b/src/game/behaviors/bouncing_fireball.inc.c @@ -27,9 +27,15 @@ void bhv_bouncing_fireball_flame_loop(void) { o->oInteractStatus = 0; } +void bhv_bouncing_fireball_override_ownership(u8* shouldOverride, u8* shouldOwn) { + *shouldOverride = TRUE; + *shouldOwn = (get_network_player_smallest_global() == gNetworkPlayerLocal); +} + void bhv_bouncing_fireball_loop(void) { if (!network_sync_object_initialized(o)) { - network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS); + struct SyncObject* so = network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS); + so->override_ownership = bhv_bouncing_fireball_override_ownership; network_init_object_field(o, &o->oAction); network_init_object_field(o, &o->oPrevAction); network_init_object_field(o, &o->oTimer);