mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
its now possible to set rearm vehicles in the editor && pylons now look also for non-config rearm vehicles
This commit is contained in:
28
addons/rearm/functions/fnc_isSource.sqf
Normal file
28
addons/rearm/functions/fnc_isSource.sqf
Normal file
@ -0,0 +1,28 @@
|
||||
#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]]
|
||||
];
|
||||
|
||||
private _vehCfg = configFile >> "CfgVehicles" >> typeOf _target;
|
||||
private _vanillaCargoConfig = getNumber (_vehCfg >> "transportAmmo");
|
||||
private _rearmCargoConfig = getNumber (_vehCfg >> QGVAR(defaultSupply));
|
||||
private _supplyVehicle = _target getVariable [QGVAR(isSupplyVehicle), false];
|
||||
|
||||
_rearmCargoConfig > 0 || {_supplyVehicle} || {_testVanillaRearm && _vanillaCargoConfig > 0}
|
Reference in New Issue
Block a user