diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 99282f77..f0639cd5 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -218,14 +218,16 @@ void Creature::RemoveFromWorld() Unit::RemoveFromWorld(); } -void Creature::RemoveCorpse() +void Creature::RemoveCorpse(bool inPlace) { - // since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless - if (uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow())) - { sPoolMgr.UpdatePool(*GetMap()->GetPersistentState(), poolid, GetGUIDLow()); } - - if (!IsInWorld()) // can be despawned by update pool - { return; } + if (!inPlace) + { + // since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless + if (uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow())) + { sPoolMgr.UpdatePool(*GetMap()->GetPersistentState(), poolid, GetGUIDLow()); } + if (!IsInWorld()) // can be despawned by update pool + { return; } + } if ((GetDeathState() != CORPSE && !m_IsDeadByDefault) || (GetDeathState() != ALIVE && m_IsDeadByDefault)) { return; } @@ -1711,7 +1713,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn) if (IsAlive()) { SetDeathState(JUST_DIED); } - RemoveCorpse(); + RemoveCorpse(true); // force corpse removal in the same grid SetHealth(0); // just for nice GM-mode view } diff --git a/src/game/Object/Creature.h b/src/game/Object/Creature.h index 418cfea5..b304ed7b 100644 --- a/src/game/Object/Creature.h +++ b/src/game/Object/Creature.h @@ -736,7 +736,7 @@ class Creature : public Unit bool IsVisibleInGridForPlayer(Player* pl) const override; - void RemoveCorpse(); + void RemoveCorpse(bool inPlace = false); bool IsDeadByDefault() const { return m_IsDeadByDefault; }; void ForcedDespawn(uint32 timeMSToDespawn = 0);