Core/Unit: Fix crash when exiting a vehicle

Ref #25649

(cherry picked from commit b84b92506354fc37017cb687aac263218265cf06)
This commit is contained in:
jackpoz
2022-03-06 20:01:38 +01:00
committed by Shauren
parent 730a8da9e9
commit c93d6856c7
+6
View File
@@ -12029,6 +12029,12 @@ void Unit::_ExitVehicle(Position const* exitPosition)
VehicleSeatAddon const* seatAddon = m_vehicle->GetSeatAddonForSeatOfPassenger(this);
Vehicle* vehicle = m_vehicle->RemovePassenger(this);
if (!vehicle)
{
TC_LOG_ERROR("entities.vehicle", "RemovePassenger() couldn't remove current unit from vehicle. Debug info: %s", GetDebugInfo().c_str());
return;
}
Player* player = ToPlayer();
// If the player is on mounted duel and exits the mount, he should immediatly lose the duel