mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
fix(Core/pathing): incorrect pathing of caster mobs when their casts fail due to LOS (#7472)
* Fix incorrect pathing of caster mobs when their casts fail due to LOS The original problem was that the casters, when their casts were blocked by a los of line of sight, would not run directly towards the player, but would rather run around within the spell range until a clear line of sight was found. This made it near impossible to make casters stop their casts and force them into melee range by using an obstacle. This fix makes caster mobs run directly into melee until a clear line of sight is reached whenever a player hides behind an obstacle regardless of whether the mob is within spell range or not. * Cleaning up whitespace * Tidying up
This commit is contained in:
@@ -114,7 +114,13 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
if (PositionOkay(owner, target, maxRange, angle) && !owner->HasUnitState(UNIT_STATE_CHASE_MOVE))
|
||||
return true;
|
||||
|
||||
bool moveToward = !owner->IsInDist(target, maxRange);
|
||||
float tarX, tarY, tarZ;
|
||||
target->GetPosition(tarX, tarY, tarZ);
|
||||
|
||||
bool withinRange = owner->IsInDist(target, maxRange);
|
||||
bool withinLOS = owner->IsWithinLOS(tarX, tarY, tarZ);
|
||||
bool moveToward = !(withinRange && withinLOS);
|
||||
|
||||
_mutualChase = mutualChase;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_CHASE_MOVE))
|
||||
|
||||
Reference in New Issue
Block a user