fix(Core/Unit): Improve vehicle exit safety checks and fallback logic (#24612)

This commit is contained in:
sogladev
2026-03-21 02:04:33 +01:00
committed by GitHub
parent 4955ecbd8c
commit 67918db7a0

View File

@@ -15714,6 +15714,12 @@ void Unit::_ExitVehicle(Position const* exitPosition)
pos.RelocateOffset({ seatAddon->ExitParameterX, seatAddon->ExitParameterY, seatAddon->ExitParameterZ, seatAddon->ExitParameterO });
else if (seatAddon->ExitParameter == VehicleExitParameters::VehicleExitParamDest)
pos.Relocate({ seatAddon->ExitParameterX, seatAddon->ExitParameterY, seatAddon->ExitParameterZ, seatAddon->ExitParameterO });
bool isInLoS = GetMap()->isInLineOfSight(GetPositionX(), GetPositionY(), GetPositionZ(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), GetPhaseMask(), LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags::Nothing);
float floorZ = GetMapHeight(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
if (!isInLoS || pos.GetPositionZ() < floorZ)
pos = vehicleBase->GetPosition();
}
}