ACE3/addons/rearm/functions/fnc_isSource.sqf
Dystopian 0321545098
Rearm - Add enable setting (#8067)
* Add enable setting

* Update test

* Optimize eden macro

* Fix bad command name in eden

* Apply suggestions from code review

Co-authored-by: jonpas <jonpas33@gmail.com>

* Cleanup unused argument

* Handle RHS config

* Optimize init function a little

* Improve macro

Co-authored-by: jonpas <jonpas33@gmail.com>

* compats and leftovers

* function header (sorry jonpas)

* add enabled check to initSupplyVehicle

* use toString

* fix validate

* inheritance cleanup

---------

Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
2023-07-28 12:47:23 +03:00

27 lines
703 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}