Skip to content

Commit

Permalink
-Custom spell fix: Bots no longer are out of range to cast spells on …
Browse files Browse the repository at this point in the history
…themselves or an item when they or the master has a distant target selected.
  • Loading branch information
mostlikely4r committed Aug 10, 2024
1 parent c0fc914 commit 68f89da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions playerbot/strategy/actions/CastCustomSpellAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ bool CastCustomSpellAction::Execute(Event& event)
itemTarget = nullptr;
}

if ((pSpellInfo->Targets & TARGET_FLAG_ITEM) || (pSpellInfo->Targets & TARGET_FLAG_SELF))
target = bot;

WorldObject* woTarget = nullptr;
if (gameObjectTarget)
woTarget = gameObjectTarget;
else
woTarget = target;

if ((pSpellInfo->Targets & TARGET_FLAG_ITEM) || (pSpellInfo->Targets & TARGET_FLAG_SELF))
woTarget = bot;

if (woTarget != bot && !sServerFacade.IsInFront(bot, woTarget, sPlayerbotAIConfig.sightDistance, CAST_ANGLE_IN_FRONT))
{
sServerFacade.SetFacingTo(bot, woTarget);
Expand Down

0 comments on commit 68f89da

Please sign in to comment.