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

Closes #19514
This commit is contained in:
ariel-
2017-05-27 00:39:32 -03:00
committed by Aokromes
parent f3c30eabbe
commit f8a222aab9

View File

@@ -240,7 +240,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);
@@ -272,14 +272,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