fix(Core/SAI): Fix crash in SMART_TARGET_OWNER_OR_SUMMONER (#22789)
This commit is contained in:
parent
af31aaa374
commit
d69f61d7ab
1 changed files with 7 additions and 6 deletions
|
|
@ -3834,19 +3834,20 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
|||
{
|
||||
targets.clear();
|
||||
|
||||
if (owner->ToCreature())
|
||||
if (IsCreature(owner))
|
||||
{
|
||||
if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->ToCreature()->GetCharmerOrOwnerGUID()))
|
||||
{
|
||||
targets.push_back(base);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (IsGameObject(owner))
|
||||
{
|
||||
if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->ToGameObject()->GetOwnerGUID()))
|
||||
{
|
||||
targets.push_back(base);
|
||||
}
|
||||
}
|
||||
else if (IsPlayer(owner))
|
||||
{
|
||||
if (Unit* base = owner->ToPlayer()->GetCharmerOrOwner())
|
||||
targets.push_back(base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue