2015-01-16 23:21:47 +00:00
|
|
|
/**
|
|
|
|
* fn_useMagazine.sqf
|
|
|
|
* @Descr: Use magazine
|
|
|
|
* @Author: Glowbal
|
|
|
|
*
|
|
|
|
* @Arguments: [unit OBJECt, magazine STRING]
|
|
|
|
* @Return: BOOL True if magazine has been used.
|
|
|
|
* @PublicAPI: true
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit","_magazine","_return"];
|
|
|
|
_unit = _this select 0;
|
|
|
|
_magazine = _this select 1;
|
|
|
|
_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param;
|
|
|
|
|
|
|
|
if (!_vehicleUsage) then {
|
2015-01-18 19:09:19 +00:00
|
|
|
if (_magazine != "") then {
|
|
|
|
_unit removeMagazine _magazine;
|
|
|
|
_return = true;
|
|
|
|
} else {
|
|
|
|
_return = false;
|
|
|
|
};
|
|
|
|
[format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug);
|
2015-01-16 23:21:47 +00:00
|
|
|
_return
|
|
|
|
} else
|
|
|
|
{
|
2015-01-18 19:09:19 +00:00
|
|
|
// TODO implement shared magazine functionality
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|