fix(Core/Util): EventMap::RepeatEvent when eventId is retrieved by ExecuteEvent() call (#3426)

This commit is contained in:
Andrius Peleckas
2020-10-17 15:59:22 +03:00
committed by GitHub
parent 32da0eeb9e
commit ab5933effa
131 changed files with 558 additions and 1012 deletions

View File

@@ -98,7 +98,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_CURSE_OF_EXERTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))

View File

@@ -122,7 +122,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_VOID_STRIKE:
me->CastSpell(me->GetVictim(), SPELL_VOID_STRIKE, false);

View File

@@ -129,7 +129,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_CARRION_SWARM:
me->CastSpell(me->GetVictim(), DUNGEON_MODE(SPELL_CARRION_SWARM_N, SPELL_CARRION_SWARM_H), false);

View File

@@ -81,7 +81,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_DISEASE_EXPULSION:
me->CastSpell(me, DUNGEON_MODE(SPELL_DISEASE_EXPULSION_N, SPELL_DISEASE_EXPULSION_H), false);

View File

@@ -112,7 +112,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
switch (events.ExecuteEvent())
{
case EVENT_SPELL_SHADOW_BOLT:
me->CastSpell(me->GetVictim(), DUNGEON_MODE(SPELL_SHADOW_BOLT_N, SPELL_SHADOW_BOLT_H), false);

View File

@@ -659,7 +659,7 @@ public:
if (eventInRun)
{
actionEvents.Update(diff);
switch (uint32 currentEvent = actionEvents.GetEvent())
switch (uint32 currentEvent = actionEvents.ExecuteEvent())
{
case EVENT_ACTION_PHASE1:
SetRun(false);
@@ -815,7 +815,7 @@ public:
SetEscortPaused(false);
eventInRun = false;
me->SetTarget(0);
actionEvents.PopEvent(); // dont schedule next, do it in gossip select!
// dont schedule next, do it in gossip select!
break;
//After Gossip 1 (waypoint 8)
case EVENT_ACTION_PHASE2:
@@ -910,7 +910,6 @@ public:
pInstance->SetData(DATA_START_WAVES, 1);
SummonNextWave();
actionEvents.PopEvent();
break;
case EVENT_ACTION_PHASE2+9:
if (pInstance)
@@ -919,7 +918,6 @@ public:
Talk(SAY_PHASE210);
eventInRun = false;
SetEscortPaused(false);
actionEvents.PopEvent();
break;
// After waypoint 22
case EVENT_ACTION_PHASE3:
@@ -1110,7 +1108,6 @@ public:
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_KILLED_EPOCH);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
actionEvents.PopEvent();
eventInRun = false;
break;
case EVENT_ACTION_PHASE5:
@@ -1122,7 +1119,6 @@ public:
cr->AddThreat(me, 0.0f);
AttackStart(cr);
}
actionEvents.PopEvent();
eventInRun = false;
SetEscortPaused(true);
break;
@@ -1150,7 +1146,6 @@ public:
case EVENT_ACTION_PHASE5+3:
eventInRun = false;
me->SetVisible(false);
actionEvents.PopEvent();
break;
}
}
@@ -1163,7 +1158,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (combatEvents.GetEvent())
switch (combatEvents.ExecuteEvent())
{
case EVENT_COMBAT_EXORCISM:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
@@ -1202,7 +1197,6 @@ Creature* npc_arthas::npc_arthasAI::GetEventNpc(uint32 entry)
void npc_arthas::npc_arthasAI::ScheduleNextEvent(uint32 currentEvent, uint32 time)
{
actionEvents.PopEvent();
actionEvents.ScheduleEvent(currentEvent + 1, time);
}