Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CBA_fnc_uniqueUnitItems #902

Merged
merged 6 commits into from
Apr 15, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/common/CfgFunctions.hpp
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ class CfgFunctions {
PATHTO_FNC(removeWeapon);
PATHTO_FNC(removeMagazine);
PATHTO_FNC(removeItem);
PATHTO_FNC(unitItemsUnique);
PATHTO_FNC(weaponComponents);
PATHTO_FNC(dropWeapon);
PATHTO_FNC(dropMagazine);
9 changes: 5 additions & 4 deletions addons/common/fnc_getUniquePlayerItems.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------------
Function: CBA_fnc_getUniquePlayerItems
Function: CBA_fnc_unitItemsUnique
Description:
A function used to retrieve a unique list of items in the units inventory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A function used to [R]etrieve[s] a unique list of items in the units inventory[.]

@@ -13,7 +13,7 @@ Parameters:
Example:
(begin example)
_allItems = [player, true, false] call CBA_fnc_getUniquePlayerItems
_allItems = [player, true, false] call CBA_fnc_unitItemsUnique
(end)
Returns:
@@ -23,7 +23,7 @@ Author:
Dedmen
---------------------------------------------------------------------------- */
#include "script_component.hpp"
SCRIPT(getUniquePlayerItems);
SCRIPT(unitItemsUnique);

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

@@ -36,7 +36,8 @@ if (_weaponItems) then {
_allItems append (primaryWeaponItems _unit);
_allItems append (secondaryWeaponItems _unit);
_allItems append (handgunItems _unit);
_allItems append [ primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit,
_allItems append [
primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit,
primaryWeaponMagazine _unit, secondaryWeaponMagazine _unit, handgunMagazine _unit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one indent right.

];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same indent as _allItems append ....

};