Core/SmartAI: add missing movement generator type check on SmartAI::SetCombatMove

ref #21562

(cherry picked from commit 0e3e4353a1)
This commit is contained in:
ccrs
2019-07-19 16:07:00 +02:00
committed by Shauren
parent f1ef2f73a4
commit e94dca132b
2 changed files with 3 additions and 7 deletions

View File

@@ -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))