2015-07-03 21:14:23 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Use Equipment if any is available.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-16 18:14:54 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 2: Item classname <STRING>
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* ReturnValue:
|
2015-08-16 18:14:54 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [unit, "classname"] call ace_repair_fnc_useItem
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-16 18:14:54 +00:00
|
|
|
params ["_unit", "_item"];
|
|
|
|
TRACE_2("params",_unit,_item);
|
2015-07-03 21:14:23 +00:00
|
|
|
|
2015-08-16 18:14:54 +00:00
|
|
|
if ([_unit, _item] call EFUNC(common,hasItem)) exitwith {
|
|
|
|
[[_unit, _item], QUOTE(EFUNC(common,useItem)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
|
|
|
[true, _unit];
|
2015-07-03 21:14:23 +00:00
|
|
|
};
|
|
|
|
[false, objNull];
|