aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/SmartScripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/AI/SmartScripts')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp4
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 6cac09f35fb..06e8fd994cf 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -638,9 +638,9 @@ void SmartAI::ReceiveEmote(Player* player, uint32 textEmote)
GetScript()->ProcessEventsFor(SMART_EVENT_RECEIVE_EMOTE, player, textEmote);
}
-void SmartAI::IsSummonedBy(Unit* summoner)
+void SmartAI::IsSummonedBy(WorldObject* summoner)
{
- GetScript()->ProcessEventsFor(SMART_EVENT_JUST_SUMMONED, summoner);
+ GetScript()->ProcessEventsFor(SMART_EVENT_JUST_SUMMONED, summoner->ToUnit(), 0, 0, false, nullptr, summoner->ToGameObject());
}
void SmartAI::DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType /*damagetype*/)
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 806902d9072..4acb1488a53 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -120,7 +120,7 @@ class TC_GAME_API SmartAI : public CreatureAI
void MovementInform(uint32 MovementType, uint32 Data) override;
// Called when creature is summoned by another unit
- void IsSummonedBy(Unit* summoner) override;
+ void IsSummonedBy(WorldObject* summoner) override;
// Called at any Damage to any victim (before damage apply)
void DamageDealt(Unit* doneTo, uint32& damage, DamageEffectType /*damagetype*/) override;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 28b4f008b5b..fb074fd69c2 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2952,13 +2952,13 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
if (!charmerOrOwnerGuid)
if (TempSummon* tempSummon = me->ToTempSummon())
- if (Unit* summoner = tempSummon->GetSummoner())
+ if (WorldObject* summoner = tempSummon->GetSummoner())
charmerOrOwnerGuid = summoner->GetGUID();
if (!charmerOrOwnerGuid)
charmerOrOwnerGuid = me->GetCreatorGUID();
- if (Unit* owner = ObjectAccessor::GetUnit(*me, charmerOrOwnerGuid))
+ if (WorldObject* owner = ObjectAccessor::GetWorldObject(*me, charmerOrOwnerGuid))
targets.push_back(owner);
}
else if (go)
@@ -2970,7 +2970,7 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
// Get owner of owner
if (e.target.owner.useCharmerOrOwner && !targets.empty())
{
- Unit* owner = targets.front()->ToUnit();
+ WorldObject* owner = targets.front();
targets.clear();
if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->GetCharmerOrOwnerGUID()))