2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-23 17:32:46 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2015-08-15 02:29:01 +00:00
|
|
|
|
|
|
|
params ["_vehicle"];
|
2024-02-05 17:04:24 +00:00
|
|
|
TRACE_1("params",_vehicle);
|
2015-08-15 02:29:01 +00:00
|
|
|
|
2016-09-13 21:52:51 +00:00
|
|
|
scopeName "main";
|
2015-08-15 02:29:01 +00:00
|
|
|
|
2022-08-16 14:33:15 +00:00
|
|
|
private _seats = fullCrew [_vehicle, "", true];
|
|
|
|
reverse _seats;
|
|
|
|
|
2015-08-15 02:29:01 +00:00
|
|
|
{
|
2016-09-13 21:52:51 +00:00
|
|
|
_x params ["_unit", "_role", "_cargoIndex", "_turretPath", "_isPersonTurret"];
|
2017-09-29 20:00:47 +00:00
|
|
|
if (isNull _unit && {_role == "cargo"} && {_cargoIndex > -1} && {!_isPersonTurret}) then {
|
2016-09-13 21:52:51 +00:00
|
|
|
[_cargoIndex, false] breakOut "main";
|
2015-08-15 02:29:01 +00:00
|
|
|
};
|
2022-08-16 14:33:15 +00:00
|
|
|
} forEach _seats;
|
2015-08-15 02:29:01 +00:00
|
|
|
|
|
|
|
{
|
2016-09-13 21:52:51 +00:00
|
|
|
_x params ["_unit", "_role", "_cargoIndex", "_turretPath", "_isPersonTurret"];
|
2017-09-29 20:00:47 +00:00
|
|
|
if (isNull _unit && {_cargoIndex > -1}) then {
|
2016-09-13 21:52:51 +00:00
|
|
|
[_cargoIndex, true] breakOut "main";
|
2015-08-15 02:29:01 +00:00
|
|
|
};
|
2022-08-16 14:33:15 +00:00
|
|
|
} forEach _seats;
|
2015-08-15 02:29:01 +00:00
|
|
|
|
2016-09-13 21:52:51 +00:00
|
|
|
[-1, false]
|