From 5dae482c9570c01c9c8e139838c6dad8d157a130 Mon Sep 17 00:00:00 2001 From: DCurrent Date: Wed, 3 Dec 2025 18:15:58 -0500 Subject: [PATCH 1/2] Fix logic mistake that caused player corpse removal regardless of death flags. --- engine/openbor.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/engine/openbor.c b/engine/openbor.c index f5ee775d..3c14c159 100644 --- a/engine/openbor.c +++ b/engine/openbor.c @@ -39390,15 +39390,25 @@ void player_die() player[playerindex].spawnhealth = self->modeldata.health; player[playerindex].spawnmp = self->modeldata.mp; - if(self->modeldata.death_config_flags & ~(DEATH_CONFIG_REMOVE_CORPSE_AIR | DEATH_CONFIG_REMOVE_CORPSE_GROUND)) - { - kill_entity(self, KILL_ENTITY_TRIGGER_PLAYER_DEATH); - } - else - { + /* + * Handle the body. If any corpse flags + * are set, we leave entity on screen + * and make it inert. Otherwise we can + * just run kill function to remove. + * + * REMOVE_CORPSE_* flags refer to how + * the live entity is removed from the + * game while leaving a corpse behind. + */ + + const e_death_config_flags leave_corpse = DEATH_CONFIG_REMOVE_CORPSE_AIR | DEATH_CONFIG_REMOVE_CORPSE_GROUND; + + if (self->modeldata.death_config_flags & leave_corpse) { self->think = NULL; self->takeaction = NULL; - self->death_state |= DEATH_STATE_CORPSE; + self->death_state |= DEATH_STATE_CORPSE; + } else { + kill_entity(self, KILL_ENTITY_TRIGGER_PLAYER_DEATH); } if(player[playerindex].lives <= 0) From 7a293b79cc698d50e9e3a9e74d3bff8ef2108b0b Mon Sep 17 00:00:00 2001 From: DCurrent Date: Wed, 3 Dec 2025 18:19:51 -0500 Subject: [PATCH 2/2] Very minor edit. Should have made previous update a static const. --- engine/openbor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/openbor.c b/engine/openbor.c index 3c14c159..4aeffac4 100644 --- a/engine/openbor.c +++ b/engine/openbor.c @@ -39401,7 +39401,7 @@ void player_die() * game while leaving a corpse behind. */ - const e_death_config_flags leave_corpse = DEATH_CONFIG_REMOVE_CORPSE_AIR | DEATH_CONFIG_REMOVE_CORPSE_GROUND; + static const e_death_config_flags leave_corpse = DEATH_CONFIG_REMOVE_CORPSE_AIR | DEATH_CONFIG_REMOVE_CORPSE_GROUND; if (self->modeldata.death_config_flags & leave_corpse) { self->think = NULL;