Fixed manta ring spawning and likely other object desync bugs

This commit is contained in:
David Joslin 2023-11-19 18:21:40 -08:00 committed by Agent X
parent 520cff93d9
commit da95b3febe
2 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -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; }
}