Fix pokey death issue (#702)

This commit is contained in:
Sunk 2025-03-11 21:40:08 -04:00 committed by GitHub
parent 14313a5cb1
commit dae7854c3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -46,7 +46,11 @@ void bhv_pokey_body_part_update(void) {
f32 baseHeight;
if (o->parentObj == NULL || o->parentObj->behavior != smlua_override_behavior(bhvPokey) || o->parentObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) {
obj_mark_for_deletion(o);
if (o->oBehParams2ndByte == 0) {
obj_die_if_health_non_positive();
} else {
obj_mark_for_deletion(o);
}
return;
}

View file

@ -650,7 +650,7 @@ s32 obj_resolve_collisions_and_turn(s16 targetYaw, s16 turnSpeed) {
void obj_die_if_health_non_positive(void) {
if (!o) { return; }
if (o->oHealth <= 0) {
if (o->oHealth <= 0 || o->oSyncDeath) {
if (o->oDeathSound == 0) {
spawn_mist_particles_with_sound(SOUND_OBJ_DEFAULT_DEATH);
} else if (o->oDeathSound > 0) {