mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Scripts/VioletHold: fix stack overflow when reflecting 'Splash'
Closes #19514
(cherry picked from commit d9a1c82ab4)
This commit is contained in:
@@ -243,7 +243,7 @@ class npc_ichor_globule : public CreatureScript
|
||||
|
||||
struct npc_ichor_globuleAI : public ScriptedAI
|
||||
{
|
||||
npc_ichor_globuleAI(Creature* creature) : ScriptedAI(creature)
|
||||
npc_ichor_globuleAI(Creature* creature) : ScriptedAI(creature), _splashTriggered(false)
|
||||
{
|
||||
_instance = creature->GetInstanceScript();
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
@@ -275,14 +275,21 @@ class npc_ichor_globule : public CreatureScript
|
||||
// this feature should be still implemented
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
{
|
||||
if (_splashTriggered)
|
||||
return;
|
||||
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
_splashTriggered = true;
|
||||
DoCastAOE(SPELL_SPLASH);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override { }
|
||||
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
bool _splashTriggered;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
|
||||
Reference in New Issue
Block a user