Fix count problems

This commit is contained in:
PabstMirror 2015-08-14 20:13:41 -05:00
parent e3a31687a8
commit b9db03de20
5 changed files with 9 additions and 10 deletions

View File

@ -123,7 +123,7 @@ _addToCrateCount = [];
_addToCrateCount pushBack 1;
};
};
} count _targetItemsStart;
} forEach _targetItemsStart;
//Add the items to the holder (combined to reduce addItemCargoGlobal calls)
{

View File

@ -31,12 +31,12 @@ _itemsToAdd = [];
if (_x == (vest _target)) then {
_itemsToAdd = _itemsToAdd + (vestItems _target);
};
} count _listOfObjectsToRemove;
} forEach _listOfObjectsToRemove;
{
if (!(_x in _listOfObjectsToRemove)) then {
_listOfObjectsToRemove pushBack _x;
};
} count _itemsToAdd;
} forEach _itemsToAdd;
[_caller, _target, _listOfObjectsToRemove] call FUNC(disarmDropItems);

View File

@ -18,15 +18,14 @@
params ["_target"];
private ["_allGear"];
private ["_items", "_counts"];
_items = [];
_counts = [];
{
_x params ["_item", "_count"];
_item append _item;
_count append _count;
} count [(getWeaponCargo _target), (getItemCargo _target), (getMagazineCargo _target), (getBackpackCargo _target)];
_items append _item;
_counts append _count;
} forEach [(getWeaponCargo _target), (getItemCargo _target), (getMagazineCargo _target), (getBackpackCargo _target)];
[_items,_counts] // Return

View File

@ -50,6 +50,6 @@ _classnamesCount = [];
_uniqueClassnames pushBack _x;
_classnamesCount pushBack 1;
};
} count _allItems;
} forEach _allItems;
[_uniqueClassnames, _classnamesCount]

View File

@ -37,6 +37,6 @@ _problem = false;
_index = _beginingArray find _x;
if (_index == -1) exitWith {_problem = true;};
_beginingArray deleteAt _index;
} count (_endA + _endB);
} forEach (_endA + _endB);
(!_problem) && {_beginingArray isEqualTo []}