Added vehicle existance check

This commit is contained in:
BaerMitUmlaut 2016-02-29 19:18:59 +01:00
parent 05c16a5dfb
commit 5b4072bf50
3 changed files with 27 additions and 0 deletions

View File

@ -6,6 +6,7 @@ PREP(canCutRopes);
PREP(canDeployRopes);
PREP(canFastRope);
PREP(canPrepareFRIES);
PREP(checkVehicleThread);
PREP(cutRopes);
PREP(deployRopes);
PREP(equipFRIES);

View File

@ -0,0 +1,25 @@
/*
* Author: BaerMitUmlaut
* Checks if the given helicopter still exits, and if not, destroys the FRIES.
*
* Arguments:
* 0: The helicopter <OBJECT>
* 1: The helicopter's FRIES <OBJECT>
*
* 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);
};

View File

@ -35,5 +35,6 @@ if !(isNumber (_config >> QGVAR(enabled))) then {
[_vehicle] call FUNC(cutRopes);
};
}];
[FUNC(checkVehicleThread), [_vehicle, _fries], 5] call EFUNC(common,waitAndExecute);
};
};