mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
44 lines
1.0 KiB
Plaintext
44 lines
1.0 KiB
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: CAA-Picard, johnb43
|
|
* Check if a unit can check the ammo of the target.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit equipped with the weapon <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Can check ammo <BOOL>
|
|
*
|
|
* Example:
|
|
* [cursorObject] call ace_reload_fnc_canCheckAmmo
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_target"];
|
|
|
|
// Static weapons
|
|
if (_target isKindOf "StaticWeapon") exitWith {
|
|
// No check ammo action on destroyed static weapons
|
|
if (!alive _target) exitWith {false};
|
|
|
|
if (currentMagazine _target != "") exitWith {true};
|
|
|
|
// Check for loaded magazines
|
|
(magazinesAmmoFull _target) findIf {_x select 2} != -1
|
|
};
|
|
|
|
// All other vehicles
|
|
if !(_target isKindOf "CAManBase") exitWith {false};
|
|
|
|
// For men
|
|
if (currentWeapon _target == "") exitWith {false};
|
|
|
|
// Check if their current magazine is a belt
|
|
if (getNumber (configFile >> "CfgMagazines" >> currentMagazine _target >> "ACE_isBelt") == 1) exitWith {true};
|
|
|
|
// Check for rocket launchers
|
|
if (currentWeapon _target == secondaryWeapon _target) exitWith {true};
|
|
|
|
false
|