diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index 586f5b8c1b2..4d02f54c364 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -711,6 +711,10 @@ std::shared_ptr Creature::getCorpse(const std::shared_ptr &, con } void Creature::changeHealth(int32_t healthChange, bool sendHealthChange /* = true*/) { + if (isLifeless()) { + return; + } + int32_t oldHealth = health; if (healthChange > 0) { diff --git a/src/creatures/creature.hpp b/src/creatures/creature.hpp index 35f39292609..a42ceee5160 100644 --- a/src/creatures/creature.hpp +++ b/src/creatures/creature.hpp @@ -209,9 +209,14 @@ class Creature : virtual public Thing, public SharedObject { } bool isAlive() const { - return !isDead(); + return !isLifeless(); } + bool isLifeless() const { + return health <= 0; + } + + virtual int32_t getMaxHealth() const { return healthMax; } diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index 690ebd10b39..286b1855d13 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -1109,7 +1109,7 @@ void Monster::onThink_async() { void Monster::doAttacking(uint32_t interval) { const auto &attackedCreature = getAttackedCreature(); - if (!attackedCreature || (isSummon() && attackedCreature.get() == this)) { + if (!attackedCreature || attackedCreature->isLifeless() || (isSummon() && attackedCreature.get() == this)) { return; }