fix(Core/Unit): Improve vehicle exit safety checks and fallback logic (#24612)
This commit is contained in:
parent
4955ecbd8c
commit
67918db7a0
1 changed files with 6 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue