ACE3/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf

26 lines
491 B
Plaintext
Raw Normal View History

2015-01-12 22:35:40 +00:00
/**
* 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