ACE3/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf
mharis001 803d497d8a Improve checking of unit items (#6350)
* 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
2018-09-17 14:03:28 -05:00

26 lines
490 B
Plaintext

/*
* Author: commy2
* Handle the InventoryChanged event.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Weapon <STRING>
*
* Return Value:
* None
*
* Example:
* [bob, "weapon"] call ace_sandbag_fnc_handlePlayerInventoryChanged
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
if (_unit getVariable [QGVAR(isDeploying), false]) then {
if !("ACE_Sandbag_empty" in (_unit call EFUNC(common,uniqueItems))) then {
[_unit] call FUNC(deployCancel);
};
};