[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(); CombatStop();
AddObjectToRemoveList();
Unit* sum = m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL; Unit* sum = m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL;
if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->AI()) if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->AI())
{ {
((Creature*)sum)->AI()->SummonedCreatureDespawn(this); ((Creature*)sum)->AI()->SummonedCreatureDespawn(this);
} }
AddObjectToRemoveList();
} }
void TemporarySummon::SaveToDB() void TemporarySummon::SaveToDB()

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8176" #define REVISION_NR "8177"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__