2015-01-16 23:21:47 +00:00
|
|
|
/**
|
|
|
|
* fn_hasMagazine.sqf
|
|
|
|
* @Descr: Check if given unit has a magazine of given classname
|
|
|
|
* @Author: Glowbal
|
|
|
|
*
|
|
|
|
* @Arguments: [unit OBJECT, magazine STRING]
|
|
|
|
* @Return: BOOL True if unith as given magazine
|
|
|
|
* @PublicAPI: true
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit","_magazine","_return"];
|
|
|
|
_unit = _this select 0;
|
|
|
|
_magazine = _this select 1;
|
|
|
|
|
|
|
|
if (_magazine != "") then {
|
2015-01-18 19:09:19 +00:00
|
|
|
_return = (_magazine in magazines _unit);
|
2015-01-16 23:21:47 +00:00
|
|
|
} else {
|
2015-01-18 19:09:19 +00:00
|
|
|
_return = false;
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|
|
|
|
_return
|