mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9506] Add missing AI calls to inform summoner of summon-related events
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
3a5f6ff0fb
commit
d775eea9a4
4 changed files with 20 additions and 2 deletions
|
|
@ -699,6 +699,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
|
||||
// find player: owner of controlled `this` or `this` itself maybe
|
||||
Player *player = GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
// find owner of pVictim, used for creature cases, AI calls
|
||||
Unit* pOwner = pVictim->GetCharmerOrOwner();
|
||||
|
||||
if(pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->GetLootRecipient())
|
||||
player = ((Creature*)pVictim)->GetLootRecipient();
|
||||
|
||||
|
|
@ -832,7 +836,11 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
if (pSummoner->AI())
|
||||
pSummoner->AI()->SummonedCreatureJustDied(cVictim);
|
||||
}
|
||||
|
||||
else if (pOwner && pOwner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (((Creature*)pOwner)->AI())
|
||||
((Creature*)pOwner)->AI()->SummonedCreatureJustDied(cVictim);
|
||||
}
|
||||
|
||||
// Dungeon specific stuff, only applies to players killing creatures
|
||||
if(cVictim->GetInstanceId())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue