mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
feat(Core/GameObject): Expand IsSummonedBy() to GameObjects (#14789)
Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "DisableMgr.h"
|
||||
#include "DynamicVisibility.h"
|
||||
#include "Formulas.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
@@ -18081,9 +18082,19 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
}
|
||||
|
||||
if (TempSummon* summon = creature->ToTempSummon())
|
||||
if (Unit* summoner = summon->GetSummonerUnit())
|
||||
if (summoner->ToCreature() && summoner->IsAIEnabled)
|
||||
{
|
||||
if (WorldObject* summoner = summon->GetSummoner())
|
||||
{
|
||||
if (summoner->ToCreature() && summoner->ToCreature()->IsAIEnabled)
|
||||
{
|
||||
summoner->ToCreature()->AI()->SummonedCreatureDies(creature, killer);
|
||||
}
|
||||
else if (summoner->ToGameObject() && summoner->ToGameObject()->AI())
|
||||
{
|
||||
summoner->ToGameObject()->AI()->SummonedCreatureDies(creature, killer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dungeon specific stuff, only applies to players killing creatures
|
||||
if (creature->GetInstanceId())
|
||||
|
||||
Reference in New Issue
Block a user