2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-05-01 03:48:02 +00:00
|
|
|
/*
|
|
|
|
* Author: JoramD
|
|
|
|
* Handles percentage chance parachute failure.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Vehicle <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, vehicle player] call ace_parachute_fnc_handleFailureChance
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit", "_vehicle"];
|
|
|
|
|
|
|
|
if !(_vehicle isKindOf "ParachuteBase") exitWith {};
|
|
|
|
|
|
|
|
if (random 1 < GVAR(failureChance)) then {
|
|
|
|
private _failureDelay = getNumber (configOf _vehicle >> QGVAR(failureDelay));
|
|
|
|
[FUNC(cutParachute), [_unit, _vehicle], _failureDelay] call CBA_fnc_waitAndExecute;
|
|
|
|
};
|