Common - Clean up ace_common_fnc_hasItem & ace_common_fnc_hasMagazine functions (#10108)

* Clean up hasItem & hasMagazine functions

* Replace EFUNC

* Update fnc_hasItem.sqf
This commit is contained in:
johnb432 2024-07-03 17:39:04 +02:00 committed by GitHub
parent 7b0e5b6416
commit dae2c5b465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 12 deletions

View File

@ -1,21 +1,21 @@
#include "..\script_component.hpp"
/*
* Author: Glowbal
* Check if unit has item. Note: case-sensitive.
* Check if given unit has an item of given classname. Note: Case sensitive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Item Classname <STRING>
* 1: Item classname <STRING>
*
* Return Value:
* Unit has Item <BOOL>
* Unit has item <BOOL>
*
* Example:
* [bob, "item"] call ace_common_fnc_hasItem
* [player, "ACE_Banana"] call ace_common_fnc_hasItem
*
* Public: Yes
*/
params [["_unit", objNull, [objNull]], ["_item", "", [""]]];
_item in (_unit call EFUNC(common,uniqueItems))
_item in (_unit call FUNC(uniqueItems)) // return

View File

@ -1,23 +1,21 @@
#include "..\script_component.hpp"
/*
* Author: Glowbal
* Check if given unit has a magazine of given classname
* Check if given unit has a magazine of given classname. Note: Case sensitive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Magazine Classname <STRING>
* 1: Magazine classname <STRING>
*
* Return Value:
* has Magazine <BOOL>
* Unit has magazine <BOOL>
*
* Example:
* [bob, "magazine"] call ace_common_fnc_hasMagazine
* [player, "30Rnd_65x39_caseless_mag"] call ace_common_fnc_hasMagazine
*
* Public: yes
*
* Note: Case sensitive
*/
params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]];
_magazine in magazines _unit // return
_magazine in ([_unit, 2] call FUNC(uniqueItems)) // return