diff --git a/addons/fastroping/XEH_preInit.sqf b/addons/fastroping/XEH_preInit.sqf index 39aeb66a94..83bb997eac 100644 --- a/addons/fastroping/XEH_preInit.sqf +++ b/addons/fastroping/XEH_preInit.sqf @@ -6,6 +6,7 @@ PREP(canCutRopes); PREP(canDeployRopes); PREP(canFastRope); PREP(canPrepareFRIES); +PREP(checkVehicleThread); PREP(cutRopes); PREP(deployRopes); PREP(equipFRIES); diff --git a/addons/fastroping/functions/fnc_checkVehicleThread.sqf b/addons/fastroping/functions/fnc_checkVehicleThread.sqf new file mode 100644 index 0000000000..0cd0ca3234 --- /dev/null +++ b/addons/fastroping/functions/fnc_checkVehicleThread.sqf @@ -0,0 +1,25 @@ +/* + * Author: BaerMitUmlaut + * Checks if the given helicopter still exits, and if not, destroys the FRIES. + * + * Arguments: + * 0: The helicopter + * 1: The helicopter's FRIES + * + * Return Value: + * None + * + * Example: + * [_vehicle, _fries] call ace_fastroping_fnc_checkVehicleThread + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle", "_fries"]; + +if (isNull _vehicle) then { + deleteVehicle _fries; +} else { + [FUNC(checkVehicleThread), _this, 5] call EFUNC(common,waitAndExecute); +}; diff --git a/addons/fastroping/functions/fnc_equipFRIES.sqf b/addons/fastroping/functions/fnc_equipFRIES.sqf index 8e93a121f5..eaf603f938 100644 --- a/addons/fastroping/functions/fnc_equipFRIES.sqf +++ b/addons/fastroping/functions/fnc_equipFRIES.sqf @@ -35,5 +35,6 @@ if !(isNumber (_config >> QGVAR(enabled))) then { [_vehicle] call FUNC(cutRopes); }; }]; + [FUNC(checkVehicleThread), [_vehicle, _fries], 5] call EFUNC(common,waitAndExecute); }; };