Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions engine/openbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

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;
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)
Expand Down