ACE3/addons/rearm/functions/fnc_isSource.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

27 lines
706 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: shukari
* Returns if vehicle or object is a rearm source.
*
* Arguments:
* 0: Target <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorObject] call ace_rearm_fnc_isSource
*
* Public: Yes
*/
params [["_target", objNull, [objNull]]];
if ((_target getVariable [QGVAR(currentSupply), 0]) < 0) exitWith {false};
private _vehCfg = configOf _target;
private _vanillaCargoConfig = getNumber (_vehCfg >> "transportAmmo");
private _rearmCargoConfig = getNumber (_vehCfg >> QGVAR(defaultSupply));
private _supplyVehicle = _target getVariable [QGVAR(isSupplyVehicle), false];
_rearmCargoConfig > 0 || {_supplyVehicle} || {_vanillaCargoConfig > 0}