fix(Core/Unit): Improve vehicle exit safety checks and fallback logic (#24612)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user