Skip to content

Commit

Permalink
[SD3] Fix ZG crash
Browse files Browse the repository at this point in the history
  • Loading branch information
H0zen authored and billy1arm committed May 16, 2023
1 parent 3d2c84e commit eca6267
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/modules/SD3/include/sc_grid_searchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class GameObject;
class Creature;

struct ObjectDistanceOrder : public std::binary_function<const WorldObject, const WorldObject, bool>
struct ObjectDistanceOrder
{
const Unit* m_pSource;

Expand All @@ -43,7 +43,7 @@ struct ObjectDistanceOrder : public std::binary_function<const WorldObject, cons
}
};

struct ObjectDistanceOrderReversed : public std::binary_function<const WorldObject, const WorldObject, bool>
struct ObjectDistanceOrderReversed
{
const Unit* m_pSource;

Expand Down
22 changes: 10 additions & 12 deletions src/modules/SD3/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct boss_hakkar : public CreatureScript
boss_hakkarAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Reset();
}

ScriptedInstance* m_pInstance;
Expand Down Expand Up @@ -96,9 +97,16 @@ struct boss_hakkar : public CreatureScript
m_uiAspectOfThekalTimer = 8000;
m_uiAspectOfArlokkTimer = 18000;

DoCastSpellIfCan(nullptr, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);
//Needs more info. nullptr is unacceptable, see impl
//DoCastSpellIfCan(nullptr, SPELL_DOUBLE_ATTACK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT);

InitiateHakkarPowerStacks();
// Initiate Hakkar power stacks
m_creature->RemoveAurasDueToSpell(SPELL_HAKKAR_POWER);
for (uint8 i = 0; i < MAX_PRIESTS; i++)
{
if (m_pInstance->GetData(i) != DONE)
m_creature->CastSpell(m_creature, SPELL_HAKKAR_POWER, false);
}
}

void Aggro(Unit* /*who*/) override
Expand Down Expand Up @@ -131,16 +139,6 @@ struct boss_hakkar : public CreatureScript
}
}

void InitiateHakkarPowerStacks()
{
m_creature->RemoveAurasDueToSpell(SPELL_HAKKAR_POWER);
for (uint8 i = 0; i < MAX_PRIESTS; i++)
{
if (m_pInstance->GetData(i) != DONE)
m_creature->CastSpell(m_creature, SPELL_HAKKAR_POWER,false);
}
}

void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
Expand Down

0 comments on commit eca6267

Please sign in to comment.