mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9241] Implement AI/EventAI calls at summoned creature die/despawn
* New CreatureAI::SummonedCreatureJustDie called for owner at temporary summoned creature die. * New EVENT_T_SUMMONED_JUST_DIE (25) for proccess CreatureAI::SummonedCreatureJustDie event * New EVENT_T_SUMMONED_JUST_DESPAWN (26) for proccess CreatureAI::SummonedCreatureJustDespawn event * Some code cleanups.
This commit is contained in:
parent
75381e31f8
commit
36d90d6040
9 changed files with 110 additions and 42 deletions
|
|
@ -165,11 +165,10 @@ void TemporarySummon::UnSummon()
|
|||
{
|
||||
CombatStop();
|
||||
|
||||
Unit* sum = m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL;
|
||||
if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->AI())
|
||||
{
|
||||
((Creature*)sum)->AI()->SummonedCreatureDespawn(this);
|
||||
}
|
||||
if (IS_CREATURE_GUID(GetSummonerGUID()))
|
||||
if(Creature* sum = GetMap()->GetCreature(GetSummonerGUID()))
|
||||
if (sum->AI())
|
||||
sum->AI()->SummonedCreatureDespawn(this);
|
||||
|
||||
AddObjectToRemoveList();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue