2015-01-16 23:21:47 +00:00
|
|
|
/**
|
|
|
|
* 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 {
|
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;
|
|
|
|
}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
|
|
|
};
|
|
|
|
|
|
|
|
_return
|