Skip to content

Commit

Permalink
Fix uniqueUnitItems typo and add assignedItems switch (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
dedmen authored and commy2 committed May 17, 2018
1 parent 9b24ae3 commit b1fb981
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions addons/common/fnc_uniqueUnitItems.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Parameters:
_backpack - Include items in backpack (Default: true)
_vest - Include items in vest (Default: true)
_uniform - Include items in uniform (Default: true)
_assignedItems - Include assigned items (Default: true)
Example:
(begin example)
Expand All @@ -25,12 +26,12 @@ Author:
#include "script_component.hpp"
SCRIPT(uniqueUnitItems);

params [["_unit", objNull, [objNull]], ["_weaponItems", true, [true]], ["_backpack", true, [true]], ["_vest", true, [true]], ["_uniform", true, [true]]];
params [["_unit", objNull, [objNull]], ["_weaponItems", false, [true]], ["_backpack", true, [true]], ["_vest", true, [true]], ["_uniform", true, [true]], ["_assignedItems", true, [true]]];

private _allItems = (assignedItems _unit);
if (_uniform) then {_allItems append ((getItemCargo (uniformContainer _unit)) select 0);};
if (_vest) then {_allItems append ((getItemCargo (vestContainer _unit)) select 0);};
if (_backpack) then {_allItems append ((getItemCargo (backpackContainer _unit)) select 0);};
private _allItems = if (_assignedItems) then {assignedItems _unit} else {[]};
if (_uniform) then {_allItems append ((getItemCargo (uniformContainer _unit)) select 0)};
if (_vest) then {_allItems append ((getItemCargo (vestContainer _unit)) select 0)};
if (_backpack) then {_allItems append ((getItemCargo (backpackContainer _unit)) select 0)};

if (_weaponItems) then {
_allItems append (primaryWeaponItems _unit);
Expand Down

0 comments on commit b1fb981

Please sign in to comment.