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

Closes #19514

(cherry picked from commit d9a1c82ab4)
This commit is contained in:
ariel-
2017-05-27 00:39:32 -03:00
committed by funjoker
parent a3439b6555
commit b161447b47

View File

@@ -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