ACE3/addons/common/functions/fnc_getNumberMagazinesIn.sqf
2015-01-17 00:21:47 +01:00

28 lines
524 B
Plaintext

/**
* fn_getNumberMagazinesIn.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: true
*/
#include "script_component.hpp"
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