mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
803d497d8a
* Add uniqueItems function * Optimize dogtag children actions function * Optimize getDetonators item search * Store CfgWeapons lookup in getDetonators * Update items to use new function * Update items to use new function 2 * More optimization of uniqueItems function * Update items to use new function 3
23 lines
516 B
Plaintext
23 lines
516 B
Plaintext
/*
|
|
* Author: Garth 'L-H' de Wet, mharis001
|
|
* Returns all detonators the given unit has.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Config names of detonators <ARRAY>
|
|
*
|
|
* Example:
|
|
* [_player] call ace_explosives_fnc_getDetonators
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit"];
|
|
TRACE_1("Getting detonators",_unit);
|
|
|
|
private _cfgWeapons = configFile >> "CfgWeapons";
|
|
(_unit call EFUNC(common,uniqueItems)) select {getNumber (_cfgWeapons >> _x >> QGVAR(Detonator)) == 1};
|