Skip to content

Commit 1c1a281

Browse files
cgrahamsevencgrahamseven
andauthored
fix(Core/SAI): rooted check blocks vehicles from casting quest credit (azerothcore#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 azerothcore#20237 Co-authored-by: cgrahamseven <[email protected]>
1 parent 8852c38 commit 1c1a281

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/game/AI/SmartScripts/SmartScript.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
693693
bool isSpellIgnoreLOS = spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT);
694694

695695
// If target is rooted we move out of melee range before casting, but not further than spell max range.
696-
if (isWithinLOSInMap && isWithinMeleeRange && isRangedAttack && isTargetRooted && canCastSpell)
696+
if (isWithinLOSInMap && isWithinMeleeRange && isRangedAttack && isTargetRooted && canCastSpell && !me->IsVehicle())
697697
{
698698
failedSpellCast = true; // Mark spellcast as failed so we can retry it later
699699
float minDistance = std::max(meleeRange, spellMinRange) - distanceToTarget + NOMINAL_MELEE_RANGE;

0 commit comments

Comments
 (0)