Fixed manta ring spawning and likely other object desync bugs

This commit is contained in:
MysterD 2023-11-19 18:21:40 -08:00
parent c5cf321348
commit 8fb818af7f
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; }
}