Core/EventProcessor: Wait for non deletable events to get deletable.

* Immediate deletion caused issues with the SpellEvent,
  so we delete it at one of the next update ticks now.
* Only affects the unforced cancellation of events.
* Ref #16675
This commit is contained in:
Naios
2016-07-03 00:06:49 +02:00
committed by Aokromes
parent 4065ba87c6
commit 80d77dfb46
4 changed files with 67 additions and 32 deletions

View File

@@ -238,7 +238,7 @@ void Vehicle::RemoveAllPassengers()
while (!_pendingJoinEvents.empty())
{
VehicleJoinEvent* e = _pendingJoinEvents.front();
e->to_Abort = true;
e->ScheduleAbort();
e->Target = eventVehicle;
_pendingJoinEvents.pop_front();
}
@@ -429,7 +429,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
if (seat == Seats.end()) // no available seat
{
e->to_Abort = true;
e->ScheduleAbort();
return false;
}
@@ -441,7 +441,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
seat = Seats.find(seatId);
if (seat == Seats.end())
{
e->to_Abort = true;
e->ScheduleAbort();
return false;
}
@@ -704,7 +704,7 @@ void Vehicle::RemovePendingEventsForSeat(int8 seatId)
{
if ((*itr)->Seat->first == seatId)
{
(*itr)->to_Abort = true;
(*itr)->ScheduleAbort();
_pendingJoinEvents.erase(itr++);
}
else
@@ -729,7 +729,7 @@ void Vehicle::RemovePendingEventsForPassenger(Unit* passenger)
{
if ((*itr)->Passenger == passenger)
{
(*itr)->to_Abort = true;
(*itr)->ScheduleAbort();
_pendingJoinEvents.erase(itr++);
}
else

View File

@@ -478,7 +478,7 @@ void Aura::_Remove(AuraRemoveMode removeMode)
if (m_dropEvent)
{
m_dropEvent->to_Abort = true;
m_dropEvent->ScheduleAbort();
m_dropEvent = nullptr;
}
}