From 44830456046c87caa0cd7c0d4e2c93b5da9c23bc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 9 Jul 2017 16:15:14 -0500 Subject: [PATCH] Rallypoints- Don't modify setVar if already set (#5347) --- addons/respawn/functions/fnc_handleInitPostServer.sqf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index e8f4f1d110..107fbe444b 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -39,7 +39,9 @@ _leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; if (_leaderVarName != "") exitWith { // assign JIP unit as rallypoint leader if (str _unit == _leaderVarName) then { - _unit setVariable ["ACE_canMoveRallypoint", true, true]; + if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { + _unit setVariable ["ACE_canMoveRallypoint", true, true]; + }; }; }; @@ -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]; +};