mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
60cab0af6b
* Initial push * disable forgotten define * Improve exitWith check * Requested/suggested changes * Requested changes * Requested changes
27 lines
598 B
Plaintext
27 lines
598 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* 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;
|
|
};
|