Skip to content
Draft
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/creature_states.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,9 @@ long get_creature_gui_job(const struct Thing *thing)

TbBool creature_is_dying(const struct Thing *thing)
{
return (thing->health < 0);
return ((thing->active_state == DCrSt_Dying) || (thing->active_state == DCrSt_Dead));
}

TbBool creature_is_being_dropped(const struct Thing *thing)
{
CrtrStateId i = thing->active_state;
Expand Down
9 changes: 8 additions & 1 deletion src/creature_states.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "globals.h"

/** Count of creature states, originally 147. */
#define CREATURE_STATES_COUNT CrSt_ListEnd
#define CREATURE_STATES_COUNT DCrSt_ListEnd

#define FIGHT_FEAR_DELAY 160
#define STATE_TYPES_COUNT CrStTyp_ListEnd
Expand Down Expand Up @@ -190,6 +190,13 @@ enum CreatureStates {
CrSt_ListEnd,
};

enum DeadCreatureStates
{
DCrSt_Dying = CrSt_ListEnd + 1,
DCrSt_Dead,
DCrSt_ListEnd
};

enum CreatureTrainingModes {
CrTrMd_Unused = 0,
CrTrMd_SearchForTrainPost,
Expand Down
6 changes: 0 additions & 6 deletions src/thing_corpses.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ extern "C" {
struct Thing;
struct Dungeon;

enum DeadCreatureStates {
DCrSt_Unused = 0,
DCrSt_Dying,
DCrSt_Dead,
};

#pragma pack()
/******************************************************************************/
TbBool corpse_is_rottable(const struct Thing *thing);
Expand Down
2 changes: 1 addition & 1 deletion src/thing_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ TbBool explosion_affecting_thing(struct Thing *tngsrc, struct Thing *tngdst, con
cctrl->disease_caster_plyridx = tngsrc->owner;
}
}
if (tngdst->health < 0)
if (!creature_is_dying(tngdst))
{
struct CreatureBattle* battle = creature_battle_get_from_thing(origtng);
CrDeathFlags dieflags = (!creature_battle_invalid(battle)) ? CrDed_DiedInBattle : CrDed_Default;
Expand Down