From 1c1a281eda8b7f6a104850f61b8325e3844e45ef Mon Sep 17 00:00:00 2001 From: "@cgrahamseven" Date: Thu, 24 Oct 2024 04:57:52 -0500 Subject: [PATCH] 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 --- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index f68477ca0..ac6bebeca 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -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;