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

@@ -105,7 +105,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;
@@ -119,7 +119,7 @@ public:
break;
case EVENT_UNROOT:
me->SetControlled(false, UNIT_STATE_ROOT);
events.PopEvent();
break;
case EVENT_SPELL_BLIZZARD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))

View File

@@ -104,7 +104,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;
@@ -269,7 +269,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;

View File

@@ -75,7 +75,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;

View File

@@ -77,7 +77,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;

View File

@@ -91,7 +91,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;
@@ -101,7 +101,6 @@ public:
break;
case EVENT_SPELL_ARCANE_BUFFET:
me->CastSpell(me->GetVictim(), SPELL_ARCANE_BUFFET, false);
events.PopEvent();
break;
case EVENT_SUMMON_SPHERES:
{

View File

@@ -90,7 +90,7 @@ public:
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;

View File

@@ -405,7 +405,7 @@ public:
void Update(uint32 diff)
{
events.Update(diff);
switch( events.GetEvent() )
switch( events.ExecuteEvent() )
{
case 0:
break;
@@ -426,7 +426,6 @@ public:
c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
c->GetMotionMaster()->MovePoint(0, guardMovePosition);
}
events.PopEvent();
events.RescheduleEvent(EVENT_GUARDS_DISAPPEAR, 5000);
}
break;
@@ -435,7 +434,6 @@ public:
for (uint8 i = 0; i < 4; ++i)
if (Creature* c = instance->GetCreature(NPC_GuardGUID[i]))
c->SetVisible(false);
events.PopEvent();
events.RescheduleEvent(EVENT_SINCLARI_FALL_BACK, 2000);
}
break;
@@ -447,7 +445,6 @@ public:
c->GetMotionMaster()->MovePoint(0, sinclariOutsidePosition);
}
SetData(DATA_ACTIVATE_DEFENSE_SYSTEM, 0);
events.PopEvent();
events.RescheduleEvent(EVENT_START_ENCOUNTER, 4000);
}
break;
@@ -467,7 +464,6 @@ public:
HandleGameObject(0, false, go); // not used yet
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); // make it useable
}
events.PopEvent();
events.RescheduleEvent(EVENT_SUMMON_PORTAL, 4000);
}
break;
@@ -501,7 +497,6 @@ public:
events.RescheduleEvent(EVENT_CYANIGOSSA_TRANSFORM, 10000);
}
}
events.PopEvent();
break;
case EVENT_CYANIGOSSA_TRANSFORM:
if (Creature* c = instance->GetCreature(NPC_CyanigosaGUID))
@@ -510,12 +505,10 @@ public:
c->CastSpell(c, SPELL_CYANIGOSA_TRANSFORM, 0);
events.RescheduleEvent(EVENT_CYANIGOSA_ATTACK, 2500);
}
events.PopEvent();
break;
case EVENT_CYANIGOSA_ATTACK:
if (Creature* c = instance->GetCreature(NPC_CyanigosaGUID))
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC);
events.PopEvent();
break;
}
}

View File

@@ -146,7 +146,7 @@ public:
events.Update(diff);
switch(events.GetEvent())
switch(events.ExecuteEvent())
{
case 0:
break;
@@ -155,7 +155,6 @@ public:
spawned = true;
if (Creature* c = DoSummon(RAND(NPC_PORTAL_GUARDIAN, NPC_PORTAL_KEEPER), me, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN))
me->CastSpell(c, SPELL_PORTAL_CHANNEL, false);
events.PopEvent();
events.RescheduleEvent(EVENT_SUMMON_KEEPER_TRASH, 20000);
break;
case EVENT_SUMMON_KEEPER_TRASH:
@@ -174,12 +173,10 @@ public:
DoSummon(entry, me, 2.0f, 20000, TEMPSUMMON_DEAD_DESPAWN);
}
me->SetVisible(false);
events.PopEvent();
break;
case EVENT_SUMMON_SABOTEOUR:
DoSummon(NPC_SABOTEOUR, me, 2.0f, 0, TEMPSUMMON_CORPSE_DESPAWN);
me->DespawnOrUnsummon(3000);
events.PopEvent();
break;
}