Core: VehicleJoinEvent crash fix (#23136)

(cherry picked from commit 73e3fdc8b4)
This commit is contained in:
PolarCookie
2019-04-07 20:04:14 +02:00
committed by Shauren
parent 7ea8331fa1
commit fe0cff0cae

View File

@@ -778,6 +778,11 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
return true;
}
//It's possible that multiple vehicle join
//events are executed in the same update
if (Passenger->GetVehicle())
Passenger->ExitVehicle();
Passenger->SetVehicle(Target);
Seat->second.Passenger.Guid = Passenger->GetGUID();
Seat->second.Passenger.IsUnselectable = Passenger->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE);