ACE3/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf
PabstMirror b81ccca3f7 Captives - rewrite findEmptyNonFFVCargoSeat (#4348)
Simplify func using `fullCrew`
Fix #4339
also switch hard `ERROR(` macro to `WARNING(`
2016-09-13 16:52:51 -05:00

31 lines
716 B
Plaintext

/*
* Author: PabstMirror
* Loads a captive into a vehicle
*
* Arguments:
* 0: The Captive <OBJECT>
* 1: The Vehicle <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [bob, car1] call ACE_captives_fnc_vehicleCaptiveMoveIn;
*
* Public: No
*/
#include "script_component.hpp"
params ["_target","_vehicle"];
TRACE_2("params",_target,_vehicle);
private _getSeat = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat);
TRACE_1("free cargo seat",_getSeat);
_getSeat params ["_cargoIndex"];
if (_cargoIndex == -1) exitWith {WARNING("cargo index -1");};
_target moveInCargo [_vehicle, _cargoIndex];
_target assignAsCargoIndex [_vehicle, _cargoIndex];
_target setVariable [QGVAR(CargoIndex), _cargoIndex, true];