Skip to content

Commit

Permalink
group manager fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SnarkIndustries committed Jan 6, 2015
1 parent 36474d3 commit fb011e6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions DZAI/compile/group_manager.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,14 @@ while {(!isNull _unitGroup) && {(_unitGroup getVariable ["GroupSize",-1]) > 0}}
_nul = _x spawn {
_unit = _this;
_loadout = _unit getVariable ["loadout",[[],[]]];
_currentMagazines = (magazines _unit);
for "_i" from 0 to ((count (_loadout select 0)) - 1) do {
if (((_unit ammo ((_loadout select 0) select _i)) == 0) || {!((((_loadout select 1) select _i) in _currentMagazines))}) then {
_unit removeMagazines ((_loadout select 1) select _i);
_unit addMagazine ((_loadout select 1) select _i);
if ((_i == 0) && {_unit getVariable ["extraMag",false]}) then {_unit addMagazine ((_loadout select 1) select _i)};
if (!isNil "_loadout") then {
_currentMagazines = (magazines _unit);
for "_i" from 0 to ((count (_loadout select 0)) - 1) do {
if (((_unit ammo ((_loadout select 0) select _i)) == 0) || {!((((_loadout select 1) select _i) in _currentMagazines))}) then {
_unit removeMagazines ((_loadout select 1) select _i);
_unit addMagazine ((_loadout select 1) select _i);
if ((_i == 0) && {_unit getVariable ["extraMag",false]}) then {_unit addMagazine ((_loadout select 1) select _i)};
};
};
};

Expand Down

0 comments on commit fb011e6

Please sign in to comment.