Resync bouncing fireball to only have one owner

This commit is contained in:
MysterD 2021-09-05 14:42:53 -07:00
parent 3721877b6a
commit 8fb46314fa

View file

@ -27,9 +27,15 @@ void bhv_bouncing_fireball_flame_loop(void) {
o->oInteractStatus = 0; 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) { void bhv_bouncing_fireball_loop(void) {
if (!network_sync_object_initialized(o)) { 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->oAction);
network_init_object_field(o, &o->oPrevAction); network_init_object_field(o, &o->oPrevAction);
network_init_object_field(o, &o->oTimer); network_init_object_field(o, &o->oTimer);