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:
PabstMirror 2019-04-25 13:28:11 -05:00 committed by GitHub
parent 1f1d950588
commit 15401468b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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];
};