Core/Units: ported another crashfix from TC

This commit is contained in:
Ovahlord committed 2022-01-04 11:48:42 +01:00
1 parent d5db24c3d8
commit 91516e155f
1 file changed
+7
+7
View File
@@ -13604,6 +13604,13 @@ void Unit::_ExitVehicle(Position const* exitPosition)
// This should be done before dismiss, because there may be some aura removal
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.");
return;
}
Player* player = ToPlayer();
// If the player is on mounted duel and exits the mount, he should immediatly lose the duel