aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2019-01-13 20:25:02 +0100
committerShauren <shauren.trinity@gmail.com>2021-11-21 15:36:57 +0100
commited884354944009979b828d21ee3498e830050af8 (patch)
tree55fcc0cff45a6089e24d897ae2a451d623e44abe /src/server/scripts
parent159e6521cc8059d498d9d2de37d19ba3600d3592 (diff)
3.3.5 UnitAI (#22911)
* Core/AI: Revamp how UnitAI changes are applied Revamp how UnitAI changes are applied by storing current AI in a variable and all previous AIs plus current in a stack. The callers can push/pop AIs on the stack that will take effect only in next Unit::Update() call. The current AI will be a valid object for the whole duration of Unit::Update() and until next Unit::Update() call. * Core/AI: Apply new AI change code * Core/AI: Fix build * Core/AI: Fix crash on Creature::AIM_Create() * Core/AI: Fix crash * Core/AI: Restore ASSERT * Core/AI: Fix UnitAI not being popped properly when restoring a charmed AI (cherry picked from commit 8f9654d8176646c3076482477fc4b91011fb83cc)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
index 97c78e8f356..3bf56aa8f16 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
@@ -449,7 +449,7 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
return;
Player* pTarget = GetTarget()->ToPlayer();
- GetTarget()->SetAI(new player_overlord_brandAI(pTarget, GetCasterGUID()));
+ GetTarget()->PushAI(new player_overlord_brandAI(pTarget, GetCasterGUID()));
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -457,7 +457,7 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
if (GetTarget()->GetTypeId() != TYPEID_PLAYER)
return;
- GetTarget()->SetAI(nullptr);
+ GetTarget()->PopAI();
}
void Register() override