ACE3/addons/mk6mortar/functions/fnc_canUnloadMagazine.sqf
2015-12-16 23:47:14 +01:00

30 lines
605 B
Plaintext

/*
* Author: Grey
* Checks whether magazine can be unloaded from static weapon
*
* Arguments:
* 0: static <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* canUnloadMagazine <BOOL>
*
* Example:
* [_target,_player] call ace_mk6mortar_fnc_canUnloadMagazine
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_static","_unit"];
private ["_canUnloadMagazine","_ammoCount"];
if !(alive _static) exitWith {false};
_canUnloadMagazine = false;
_ammoCount = ((magazinesAllTurrets _static) select 1) select 2;
if (_ammoCount > 0) then {
_canUnloadMagazine = true;
};
_canUnloadMagazine