mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Core/Scripts: Fix a crash when swapping creatures with pending vehicle join events.
* Closes #17833
This commit is contained in:
@@ -737,12 +737,6 @@ void Vehicle::RemovePendingEventsForPassenger(Unit* passenger)
|
||||
}
|
||||
}
|
||||
|
||||
VehicleJoinEvent::~VehicleJoinEvent()
|
||||
{
|
||||
if (Target)
|
||||
Target->RemovePendingEvent(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn bool VehicleJoinEvent::Execute(uint64, uint32)
|
||||
*
|
||||
@@ -860,6 +854,9 @@ void VehicleJoinEvent::Abort(uint64)
|
||||
TC_LOG_DEBUG("entities.vehicle", "Passenger GuidLow: %u, Entry: %u, board on vehicle GuidLow: %u, Entry: %u SeatId: %d cancelled",
|
||||
Passenger->GetGUID().GetCounter(), Passenger->GetEntry(), Target->GetBase()->GetGUID().GetCounter(), Target->GetBase()->GetEntry(), (int32)Seat->first);
|
||||
|
||||
/// Remove the pending event when Abort was called on the event directly
|
||||
Target->RemovePendingEvent(this);
|
||||
|
||||
/// @SPELL_AURA_CONTROL_VEHICLE auras can be applied even when the passenger is not (yet) on the vehicle.
|
||||
/// When this code is triggered it means that something went wrong in @Vehicle::AddPassenger, and we should remove
|
||||
/// the aura manually.
|
||||
|
||||
@@ -123,7 +123,6 @@ class TC_GAME_API VehicleJoinEvent : public BasicEvent
|
||||
friend class Vehicle;
|
||||
protected:
|
||||
VehicleJoinEvent(Vehicle* v, Unit* u) : Target(v), Passenger(u), Seat(Target->Seats.end()) { }
|
||||
~VehicleJoinEvent();
|
||||
bool Execute(uint64, uint32) override;
|
||||
void Abort(uint64) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user