ACE3/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf
2015-01-12 23:35:40 +01:00

26 lines
491 B
Plaintext

/**
* fn_getNumberMagazinesIn.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: true
*/
private ["_unit","_magazine"];
_unit = _this select 0;
_magazine = _this select 1;
_return = 0;
if (_unit isKindOf "CAManBase") then {
_return = {_x == _magazine} count magazines _unit;
} else {
{
_return = _return + {_x == _magazine} count magazines _x;
}foreach (crew _unit);
_return = _return + ({_x == _magazine} count getMagazineCargo _unit);
};
_return