summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_ChangeSideSupply.sqf
blob: 6bcdc9192fb5b37c72324421e0b0db9f8fd09ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
Private ['_amount','_change','_currentSupply','_side'];

_side = _this select 0;
_amount = _this select 1;

_currentSupply = (_side) Call GetSideSupply;
if (isNil '_currentSupply') then {_currentSupply = 0};
_change = _currentSupply + _amount;
if (_change < 0) then {_change = _currentSupply - _amount};

WF_Logic setVariable [Format["%1Supplies",_side],_change,true];