From 8fb818af7ff6da81544c064c706c21f9ff96c189 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 19 Nov 2023 18:21:40 -0800 Subject: [PATCH] Fixed manta ring spawning and likely other object desync bugs --- src/game/behaviors/manta_ray.inc.c | 6 +++--- src/pc/network/sync_object.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/behaviors/manta_ray.inc.c b/src/game/behaviors/manta_ray.inc.c index acf42f87..0c5432e7 100644 --- a/src/game/behaviors/manta_ray.inc.c +++ b/src/game/behaviors/manta_ray.inc.c @@ -89,12 +89,12 @@ static void manta_ray_act_spawn_ring(void) { struct Object *ringManager = o->parentObj; struct Object *ring; - if (o->oTimer == 300) { + if (!sync_object_is_owned_locally(o->oSyncID)) { return; } + + if (o->oTimer >= 300) { o->oTimer = 0; } - if (!sync_object_is_owned_locally(o->oSyncID)) { return; } - if (o->oTimer == 0 || o->oTimer == 50 || o->oTimer == 150 || o->oTimer == 200 || o->oTimer == 250) { ring = spawn_object(o, MODEL_WATER_RING, bhvMantaRayWaterRing); if (ring != NULL) { diff --git a/src/pc/network/sync_object.c b/src/pc/network/sync_object.c index 83b6f8fd..1b40fe62 100644 --- a/src/pc/network/sync_object.c +++ b/src/pc/network/sync_object.c @@ -355,7 +355,7 @@ bool sync_object_should_own(u32 syncId) { // check distance for (s32 i = 0; i < MAX_PLAYERS; i++) { - if (i != 0 && !is_player_active(&gMarioStates[i])) { continue; } + if (i != 0 && !is_player_in_local_area(&gMarioStates[i])) { continue; } if (player_distance(&gMarioStates[0], so->o) > player_distance(&gMarioStates[i], so->o)) { return false; } }