mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
feat(Core/SmartScripts): SMART_ACTION_CALL_FOR_HELP should properly call assistance in case of polymorphed creature. (#9231)
Updates #9120
This commit is contained in:
@@ -2237,14 +2237,20 @@ void Creature::CallAssistance(Unit* target /*= nullptr*/)
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::CallForHelp(float radius)
|
||||
void Creature::CallForHelp(float radius, Unit* target /*= nullptr*/)
|
||||
{
|
||||
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
|
||||
if (radius <= 0.0f || IsPet() || IsCharmed())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
if (!target)
|
||||
{
|
||||
target = GetVictim();
|
||||
}
|
||||
|
||||
Acore::CallOfHelpCreatureInRangeDo u_do(this, target, radius);
|
||||
Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
Cell::VisitGridObjects(this, worker, radius);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user