/* * Author: GitHawk * Adds all magazines of a vehicle to the supply. * * Argument: * 0: Ammo Truck * 1: Vehicle * or * 0: Ammo Truck * 1: Vehicle class * * Return value: * None * * Example: * [ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply * [ammo_truck, "B_MBT_01_arty_F"] call ace_rearm_fnc_addVehicleMagazinesToSupply * * Public: Yes */ #include "script_component.hpp" params [["_ammoTruck", objNull, [objNull]], ["_vehicle", objNull, [objNull, ""]]]; if (isNull _ammoTruck || {typeName _vehicle == "OBJECT" && {isNull _vehicle}}) exitWith {}; private _string = ""; if (typeName _vehicle == "OBJECT") then { _string = typeOf _vehicle; }; if (typeName _vehicle == "STRING") then { _string = _vehicle; }; if (_string == "") exitWith {[]}; { private _turretPath = _x; private _magazines = [_string, _turretPath] call FUNC(getConfigMagazines); { [_ammoTruck, _x] call FUNC(addMagazineToSupply); } forEach _magazines; } forEach REARM_TURRET_PATHS;