Core/Unit: Clear threat list on units when they die (fix players having aggro on corpses)

Original suggestion by [email protected]

Fixes issue #4667

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-11-06 10:35:46 +01:00
parent 1b8007767a
commit 26d8e04351
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -12518,7 +12518,7 @@ bool Unit::CanHaveThreatList() const
return false; return false;
// only alive units can have threat list // only alive units can have threat list
if (!isAlive()) if (!isAlive() || isDying())
return false; return false;
// totems can not have threat list // totems can not have threat list
+1
View File
@@ -1478,6 +1478,7 @@ class Unit : public WorldObject
void BuildHeartBeatMsg(WorldPacket *data) const; void BuildHeartBeatMsg(WorldPacket *data) const;
bool isAlive() const { return (m_deathState == ALIVE); }; bool isAlive() const { return (m_deathState == ALIVE); };
bool isDying() const { return (m_deathState == JUST_DIED); };
bool isDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); }; bool isDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); };
DeathState getDeathState() { return m_deathState; }; DeathState getDeathState() { return m_deathState; };
virtual void setDeathState(DeathState s); // overwrited in Creature/Player/Pet virtual void setDeathState(DeathState s); // overwrited in Creature/Player/Pet