Core/Unit: Fix crash when exiting a vehicle

Port From (https://github.com/TrinityCore/TrinityCore/commit/c93d6856c727b5919ae30e04fb17bb425370ebea)
This commit is contained in:
hondacrx
2022-05-25 13:40:49 -04:00
parent b219548745
commit f2ebe247ba
+6
View File
@@ -1030,6 +1030,12 @@ namespace Game.Entities
VehicleSeatAddon seatAddon = m_vehicle.GetSeatAddonForSeatOfPassenger(this);
Vehicle vehicle = m_vehicle.RemovePassenger(this);
if (vehicle == null)
{
Log.outError(LogFilter.Vehicle, $"RemovePassenger() couldn't remove current unit from vehicle. Debug info: {GetDebugInfo()}");
return;
}
Player player = ToPlayer();
// If the player is on mounted duel and exits the mount, he should immediatly lose the duel