ACE3/addons/common/functions/fnc_getNumberMagazinesIn.sqf

29 lines
510 B
Plaintext
Raw Normal View History

2015-01-16 23:21:47 +00:00
/**
* fn_getNumberMagazinesIn.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: true
*/
#include "script_component.hpp"
2015-05-14 18:06:06 +00:00
PARAMS_2(_unit,_magazine);
2015-01-16 23:21:47 +00:00
2015-05-14 22:12:40 +00:00
private ["_return"];
2015-01-16 23:21:47 +00:00
_return = 0;
if (_unit isKindOf "CAManBase") then {
2015-01-18 19:09:19 +00:00
_return = {_x == _magazine} count magazines _unit;
2015-01-16 23:21:47 +00:00
} else {
2015-01-18 19:09:19 +00:00
{
_return = _return + {_x == _magazine} count magazines _x;
2015-05-14 18:06:06 +00:00
} forEach (crew _unit);
2015-01-16 23:21:47 +00:00
2015-01-18 19:09:19 +00:00
_return = _return + ({_x == _magazine} count getMagazineCargo _unit);
2015-01-16 23:21:47 +00:00
};
2015-05-14 22:12:40 +00:00
_return