mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
45a66ccfa1
* Add load in child actions to medical & captive * Add actions with proper structure * Move vehicles actions code to common function * Simplify code in config, Fix docs * Remove unused vars * Fix header example * Add _distance param to fnc_nearestVehiclesFreeSeat * Change docs * Fix spacing
38 lines
905 B
Plaintext
38 lines
905 B
Plaintext
/*
|
|
* Author: PabstMirror
|
|
* Finds a free cargo seat, searching non FFV first
|
|
*
|
|
* Arguments:
|
|
* 0: The Vehicle <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* ARRAY [seat index <NUMBER>, is FFV <BOOL>]
|
|
*
|
|
* Example:
|
|
* [car1] call ACE_captives_fnc_findEmptyNonFFVCargoSeat
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_vehicle"];
|
|
TRACE_1("params", _vehicle);
|
|
|
|
scopeName "main";
|
|
|
|
{
|
|
_x params ["_unit", "_role", "_cargoIndex", "_turretPath", "_isPersonTurret"];
|
|
if (isNull _unit && {_role == "cargo"} && {_cargoIndex > -1} && {!_isPersonTurret}) then {
|
|
[_cargoIndex, false] breakOut "main";
|
|
};
|
|
} forEach (fullCrew [_vehicle, "", true]);
|
|
|
|
{
|
|
_x params ["_unit", "_role", "_cargoIndex", "_turretPath", "_isPersonTurret"];
|
|
if (isNull _unit && {_cargoIndex > -1}) then {
|
|
[_cargoIndex, true] breakOut "main";
|
|
};
|
|
} forEach (fullCrew [_vehicle, "", true]);
|
|
|
|
[-1, false]
|