mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: GitHawk
|
|
* Detaches the fuel nozzle, drops it and removes player variables.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT> (optional)
|
|
* 1: Nozzle <OBJECT>
|
|
* 2: Disconnect Only <BOOL>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [player, nozzle, false] call ace_refuel_fnc_dropNozzle
|
|
* [objNull, nozzle, false] call ace_refuel_fnc_dropNozzle
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_disconnectOnly", false, [false]]];
|
|
TRACE_3("dropNozzle",_unit,_nozzle,_disconnectOnly);
|
|
|
|
detach _nozzle;
|
|
_nozzle setVariable [QGVAR(isRefueling), false, true];
|
|
|
|
if (_disconnectOnly) exitWith {};
|
|
_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 _intersections = lineIntersectsSurfaces [_posA, _posB, _unit, _nozzle, true, 1, "GEOM"];
|
|
TRACE_1("",_intersections);
|
|
if (_intersections isEqualTo []) then {
|
|
_groundPosition set [2, (getTerrainHeightASL _groundPosition) + 0.005];
|
|
} else {
|
|
_groundPosition = ((_intersections select 0) select 0) vectorAdd [0,0,0.005];
|
|
};
|
|
_nozzle setPosASL _groundPosition;
|
|
TRACE_1("finalPos",getPosATL _nozzle);
|
|
|
|
if (isNull _unit) exitWith {};
|
|
_unit setVariable [QGVAR(isRefueling), false];
|
|
_unit setVariable [QGVAR(nozzle), objNull, true];
|