Skip to content

Instantly share code, notes, and snippets.

@vahzxz
Last active April 9, 2024 08:21
Show Gist options
  • Save vahzxz/5cf24c07356494810eb9fb9418552de0 to your computer and use it in GitHub Desktop.
Save vahzxz/5cf24c07356494810eb9fb9418552de0 to your computer and use it in GitHub Desktop.
Fixed auto attacks in the Passive rack caused by SmartAI
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -302,7 +302,17 @@ void SmartAI::UpdateAI(uint32 diff)
UpdateDespawn(diff);
if (!IsAIControlled())
+ {
+ if (CharmInfo* charmInfo = me->GetCharmInfo())
+ {
+ if (charmInfo->IsCommandAttack() && _canAutoAttack)
+ {
+ DoMeleeAttackIfReady();
+ }
+ }
+
return;
+ }
if (!hasVictim)
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment