[8177] Fixed calling SummonedCreatureDespawn from TemporarySummon::UnSummon

* If we call AddObjectToRemoveList m_inWorld is set to false and
  ObjectAccessor::GetUnit always returns NULL.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-13 22:11:32 +02:00
parent c96f8e3d9f
commit 2b09bb19eb
2 changed files with 3 additions and 3 deletions

View file

@ -165,13 +165,13 @@ void TemporarySummon::UnSummon()
{
CombatStop();
AddObjectToRemoveList();
Unit* sum = m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL;
if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->AI())
{
((Creature*)sum)->AI()->SummonedCreatureDespawn(this);
}
AddObjectToRemoveList();
}
void TemporarySummon::SaveToDB()