Prevent Boos from being brought back from the dead through desync

This commit is contained in:
MysterD 2020-09-19 17:13:46 -07:00
parent 1467e021b3
commit c013f9d16a
3 changed files with 10 additions and 5 deletions

View file

@ -19,8 +19,13 @@ static s16 sCourtyardBooTripletPositions[][3] = {
{-210, 70, -210}
};
static u8 boo_ignore_update(void) {
return (o->oHealth == 0);
}
struct SyncObject* boo_network_init_object(void) {
struct SyncObject* so = network_init_object(o, 4000.0f);
so->ignore_if_true = boo_ignore_update;
network_init_object_field(o, &o->oBooBaseScale);
network_init_object_field(o, &o->oBooNegatedAggressiveness);
network_init_object_field(o, &o->oBooOscillationTimer);
@ -735,7 +740,7 @@ static void (*sBooGivingStarActions[])(void) = {
};
u8 big_boo_ignore_update(void) {
return cur_obj_has_behavior(bhvGhostHuntBigBoo) && !bigBooActivated;
return o->oHealth == 0 || (cur_obj_has_behavior(bhvGhostHuntBigBoo) && !bigBooActivated);
}
void bhv_big_boo_loop(void) {
@ -744,7 +749,7 @@ void bhv_big_boo_loop(void) {
bigBooActivated = FALSE;
struct SyncObject* so = boo_network_init_object();
so->syncDeathEvent = FALSE;
so->ignore_if_true = &big_boo_ignore_update;
so->ignore_if_true = big_boo_ignore_update;
}
} else if (o->oHealth <= 0) {
if (network_sync_object_initialized(o)) {

View file

@ -178,8 +178,8 @@ static void cannon_on_received(void) {
void bhv_cannon_base_loop(void) {
if (!network_sync_object_initialized(o)) {
struct SyncObject* so = network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
so->ignore_if_true = &cannon_ignore_remote_updates;
so->on_received = &cannon_on_received;
so->ignore_if_true = cannon_ignore_remote_updates;
so->on_received = cannon_on_received;
network_init_object_field(o, &o->oAction);
network_init_object_field(o, &o->oPrevAction);
network_init_object_field(o, &o->oTimer);

View file

@ -364,7 +364,7 @@ u8 king_bobomb_ignore_if_true(void) { return o->oAction == 8; }
void bhv_king_bobomb_loop(void) {
if (!network_sync_object_initialized(o)) {
struct SyncObject* so = network_init_object(o, 4000.0f);
so->ignore_if_true = &king_bobomb_ignore_if_true;
so->ignore_if_true = king_bobomb_ignore_if_true;
network_init_object_field(o, &o->oKingBobombUnk88);
network_init_object_field(o, &o->oFlags);
network_init_object_field(o, &o->oHealth);