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
|
|
@ -98,13 +98,9 @@ void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
|
|||
{
|
||||
TemporarySummon* pSummon = (TemporarySummon*)(&unit);
|
||||
if (IS_CREATURE_GUID(pSummon->GetSummonerGUID()))
|
||||
{
|
||||
if (Unit* pSummoner = pSummon->GetSummoner())
|
||||
{
|
||||
if (((Creature*)pSummoner)->AI())
|
||||
((Creature*)pSummoner)->AI()->SummonedMovementInform(&unit, POINT_MOTION_TYPE, id);
|
||||
}
|
||||
}
|
||||
if(Creature* pSummoner = unit.GetMap()->GetCreature(pSummon->GetSummonerGUID()))
|
||||
if (pSummoner->AI())
|
||||
pSummoner->AI()->SummonedMovementInform(&unit, POINT_MOTION_TYPE, id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue