2018-07-09 17:20:55 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
/*
|
|
|
|
* Author: shukari
|
|
|
|
* Returns if vehicle or object is a rearm source.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: target <OBJECT>
|
|
|
|
* 1: check for vanilla rearm vehicle <BOOL> (default: false)
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [cursorObject] call ace_rearm_fnc_isSource
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
params [
|
|
|
|
["_target", objNull, [objNull]],
|
|
|
|
["_testVanillaRearm", false, [false]]
|
|
|
|
];
|
|
|
|
|
2018-11-02 21:56:16 +00:00
|
|
|
if ((_target getVariable [QGVAR(currentSupply), 0]) < 0) exitWith {false};
|
2021-10-30 21:42:03 +00:00
|
|
|
|
2021-02-18 18:58:08 +00:00
|
|
|
private _vehCfg = configOf _target;
|
2018-07-09 17:20:55 +00:00
|
|
|
private _vanillaCargoConfig = getNumber (_vehCfg >> "transportAmmo");
|
|
|
|
private _rearmCargoConfig = getNumber (_vehCfg >> QGVAR(defaultSupply));
|
|
|
|
private _supplyVehicle = _target getVariable [QGVAR(isSupplyVehicle), false];
|
|
|
|
|
|
|
|
_rearmCargoConfig > 0 || {_supplyVehicle} || {_testVanillaRearm && _vanillaCargoConfig > 0}
|