mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -04:00
Core/SmartAI: add missing movement generator type check on SmartAI::SetCombatMove
ref #21562
(cherry picked from commit 0e3e4353a1)
This commit is contained in:
@@ -563,9 +563,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
if (e.action.cast.castFlags & SMARTCAST_COMBAT_MOVE)
|
||||
{
|
||||
// If cast flag SMARTCAST_COMBAT_MOVE is set combat movement will not be allowed
|
||||
// unless target is outside spell range, out of mana, or LOS.
|
||||
|
||||
// If cast flag SMARTCAST_COMBAT_MOVE is set combat movement will not be allowed unless target is outside spell range, out of mana, or LOS.
|
||||
bool allowMove = false;
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(e.action.cast.spell, me->GetMap()->GetDifficultyID());
|
||||
std::vector<SpellPowerCost> costs = spellInfo->CalcPowerCost(me, spellInfo->GetSchoolMask());
|
||||
@@ -588,11 +586,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (me->GetDistance(target) > spellInfo->GetMaxRange(true) ||
|
||||
me->GetDistance(target) < spellInfo->GetMinRange(true) ||
|
||||
if (me->GetDistance(target) > spellInfo->GetMaxRange(true) || me->GetDistance(target) < spellInfo->GetMinRange(true) ||
|
||||
!me->IsWithinLOSInMap(target) ||
|
||||
!hasPower ||
|
||||
me->HasUnitFlag(UNIT_FLAG_SILENCED))
|
||||
|
||||
Reference in New Issue
Block a user