Scripts/VioletHold: fix stack overflow when reflecting 'Splash'

Closes #19514

(cherry picked from commit d9a1c82ab44254c280083e6297b8aec6350ab363)
This commit is contained in:
ariel-
2020-06-14 23:49:03 +02:00
committed by funjoker
parent a3439b6555
commit b161447b47
@@ -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