mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 17:13:47 +00:00
refactor(Scripts/EasternKingdoms): code cleanup (part 5) - also fix potential crash (#6923)
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "sunwell_plateau.h"
|
||||
|
||||
@@ -576,9 +576,14 @@ public:
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(10))
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* kalecgos = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_KALECGOS)))
|
||||
if (InstanceScript* instanceScript = me->GetInstanceScript())
|
||||
{
|
||||
if (Creature *kalecgos = ObjectAccessor::GetCreature(*me, instanceScript->GetGuidData(
|
||||
NPC_KALECGOS)))
|
||||
{
|
||||
kalecgos->AI()->DoAction(ACTION_ENRAGE_OTHER);
|
||||
}
|
||||
}
|
||||
DoAction(ACTION_ENRAGE);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user