Skip FRIES preparation if unnecessary

This commit is contained in:
BaerMitUmlaut 2015-12-14 21:40:15 +01:00
parent 953119a411
commit 8cfbbe4f1f
2 changed files with 9 additions and 3 deletions

View File

@ -17,9 +17,14 @@
#include "script_component.hpp"
params ["_unit", "_vehicle"];
private ["_deployedRopes", "_config"];
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
_deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
((driver _vehicle != _unit) &&
{(_vehicle getVariable [QGVAR(deploymentStage), 0]) == 2} &&
{
((_vehicle getVariable [QGVAR(deploymentStage), 0]) == 2) ||
{!(isText (_config >> QGVAR(onPrepare))) && {(_vehicle getVariable [QGVAR(deploymentStage), 0]) == 0}}
} &&
{getPos _vehicle select 2 > 2})

View File

@ -23,4 +23,5 @@ _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
(isNumber (_config >> QGVAR(enabled)) &&
{(getNumber (_config >> QGVAR(enabled)) == 1) || {!(isNull (_vehicle getVariable [QGVAR(FRIES), objNull]))}} &&
{(_vehicle getVariable [QGVAR(deploymentStage), 0]) == 0})
{(_vehicle getVariable [QGVAR(deploymentStage), 0]) == 0} &&
{isText (_config >> QGVAR(onPrepare))})