2015-12-16 19:22:18 +00:00
|
|
|
/*
|
|
|
|
* Author: Grey
|
|
|
|
* Checks whether magazine can be unloaded from static weapon
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: static <OBJECT>
|
|
|
|
* 1: unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* canUnloadMagazine <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2015-12-16 22:47:14 +00:00
|
|
|
* [_target,_player] call ace_mk6mortar_fnc_canUnloadMagazine
|
2015-12-16 19:22:18 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-12-16 22:47:14 +00:00
|
|
|
params ["_static","_unit"];
|
2015-12-16 19:22:18 +00:00
|
|
|
|
2016-02-14 13:10:28 +00:00
|
|
|
if !(alive _static && GVAR(useAmmoHandling) && _static getVariable [QGVAR(initialized),false]) exitWith {false};
|
2018-05-30 21:45:31 +00:00
|
|
|
if (_static getVariable [QGVAR(inUse), false]) exitWith {false};
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _canUnloadMagazine = false;
|
2015-12-16 19:22:18 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _ammoCount = ((magazinesAllTurrets _static) select 1) select 2;
|
2015-12-16 19:22:18 +00:00
|
|
|
if (_ammoCount > 0) then {
|
|
|
|
_canUnloadMagazine = true;
|
|
|
|
};
|
|
|
|
_canUnloadMagazine
|