Rallypoints- Don't modify setVar if already set (#5347)

This commit is contained in:
PabstMirror 2017-07-09 16:15:14 -05:00 committed by jonpas
parent 01c17271bc
commit ef90a069b7

View File

@ -39,8 +39,10 @@ _leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""];
if (_leaderVarName != "") exitWith {
// assign JIP unit as rallypoint leader
if (str _unit == _leaderVarName) then {
if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then {
_unit setVariable ["ACE_canMoveRallypoint", true, true];
};
};
};
// treat group leader
@ -61,4 +63,6 @@ if (_leaderVarName == "") then {
// prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP
_groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName];
_unit setVariable ["ACE_canMoveRallypoint", true, true];
if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then {
_unit setVariable ["ACE_canMoveRallypoint", true, true];
};