2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-05-31 15:02:25 +00:00
|
|
|
/*
|
|
|
|
* Author: Dystopian
|
2023-11-17 23:07:28 +00:00
|
|
|
* Creates actions for nearest vehicles with cargo.
|
2017-05-31 15:02:25 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2023-11-17 23:07:28 +00:00
|
|
|
* 0: Holder object (vehicle) <OBJECT>
|
2017-05-31 15:02:25 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-09-29 20:00:47 +00:00
|
|
|
* Child actions <ARRAY>
|
2017-05-31 15:02:25 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2023-11-17 23:07:28 +00:00
|
|
|
* cursorObject call ace_cargo_fnc_addCargoVehiclesActions
|
2017-05-31 15:02:25 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
params ["_vehicle"];
|
2017-05-31 22:54:57 +00:00
|
|
|
|
2017-05-31 15:02:25 +00:00
|
|
|
private _statement = {
|
2023-11-17 23:07:28 +00:00
|
|
|
params ["_item", "_loader", "_vehicle"];
|
|
|
|
|
|
|
|
[_loader, _item, _vehicle] call FUNC(startLoadIn);
|
2017-05-31 15:02:25 +00:00
|
|
|
};
|
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
private _vehicles = (nearestObjects [_vehicle, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE + 10]) select {
|
|
|
|
_x != _vehicle &&
|
|
|
|
{alive _x} &&
|
|
|
|
{locked _x < 2} &&
|
|
|
|
{_x getVariable [QGVAR(hasCargo), getNumber (configOf _x >> QGVAR(hasCargo)) == 1]} &&
|
|
|
|
{([_vehicle, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}
|
2017-09-29 20:00:47 +00:00
|
|
|
};
|
2017-05-31 15:02:25 +00:00
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
[_vehicles, _statement, _vehicle] call EFUNC(interact_menu,createVehiclesActions)
|