Skip to content

Commit

Permalink
fix(Core/SAI): rooted check blocks vehicles from casting quest credit (
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
cgrahamseven and cgrahamseven authored Oct 24, 2024
1 parent 8852c38 commit 1c1a281
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/game/AI/SmartScripts/SmartScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c1a281

Please sign in to comment.