mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Core/SAI): rooted check blocks vehicles from casting quest credit (#20283)
spell The quest SteamTank Surprise has a SmartAI entry in the db that causes the tank to cast the kill credit spell on the player when they successfully destroy a plague wagon. Currently, this spell cast is being blocked by the rooted check handler for SMART_ACTION_CAST. The change proposes that this rooted check should not apply to vehicles. Closes AzerothCore issue #20237 Co-authored-by: cgrahamseven <chris.graham@protonmail.com>
This commit is contained in:
@@ -693,7 +693,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
bool isSpellIgnoreLOS = spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT);
|
||||
|
||||
// If target is rooted we move out of melee range before casting, but not further than spell max range.
|
||||
if (isWithinLOSInMap && isWithinMeleeRange && isRangedAttack && isTargetRooted && canCastSpell)
|
||||
if (isWithinLOSInMap && isWithinMeleeRange && isRangedAttack && isTargetRooted && canCastSpell && !me->IsVehicle())
|
||||
{
|
||||
failedSpellCast = true; // Mark spellcast as failed so we can retry it later
|
||||
float minDistance = std::max(meleeRange, spellMinRange) - distanceToTarget + NOMINAL_MELEE_RANGE;
|
||||
|
||||
Reference in New Issue
Block a user