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"
|
|
|
|
|
2015-05-14 22:12:40 +00:00
|
|
|
private ["_return", "_vehicleUsage"];
|
2015-05-14 18:06:06 +00:00
|
|
|
PARAMS_2(_unit,_magazine);
|
2015-01-16 23:21:47 +00:00
|
|
|
_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
|
2015-05-14 18:06:06 +00:00
|
|
|
} else {
|
2015-01-18 19:09:19 +00:00
|
|
|
// TODO implement shared magazine functionality
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|