mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Refuel - Drop nozzle at unit's feet if no valid pos found (#6957)
* Refuel - Drop nozzle at unit's feet if no valid pos found Fix #6944 * Update fnc_dropNozzle.sqf * Update addons/refuel/functions/fnc_dropNozzle.sqf Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
parent
1f1d950588
commit
15401468b9
@ -29,11 +29,16 @@ _nozzle setVelocity [0, 0, 0];
|
||||
|
||||
private _groundPosition = getPosASL _nozzle;
|
||||
private _posA = (getPosASL _nozzle) vectorAdd [0,0,0.05];
|
||||
private _posB = (getPosASL _nozzle) vectorAdd [0,0,-1000];
|
||||
private _posB = (getPosASL _nozzle) vectorAdd [0,0,- GVAR(hoseLength)];
|
||||
private _intersections = lineIntersectsSurfaces [_posA, _posB, _unit, _nozzle, true, 1, "GEOM"];
|
||||
TRACE_1("",_intersections);
|
||||
if (_intersections isEqualTo []) then {
|
||||
_groundPosition set [2, (getTerrainHeightASL _groundPosition) + 0.005];
|
||||
WARNING_1("no ground intersections for nozzle drop @ %1",_groundPosition);
|
||||
if (!isNull _unit) then {
|
||||
_groundPosition = getPosASL _unit; // place at unit's feet
|
||||
} else {
|
||||
_groundPosition set [2, (getTerrainHeightASL _groundPosition) + 0.005];
|
||||
};
|
||||
} else {
|
||||
_groundPosition = ((_intersections select 0) select 0) vectorAdd [0,0,0.005];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user