Skip to content

Commit

Permalink
Fix uniqueUnitItems typo and add assignedItems switch
Browse files Browse the repository at this point in the history
  • Loading branch information
dedmen committed May 12, 2018
1 parent 5808da8 commit f382081
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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,9 +26,9 @@ 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);
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);};
Expand Down

0 comments on commit f382081

Please sign in to comment.