ACE3/addons/tacticalladder/functions/fnc_deployTL.sqf
BrettMayson 1e404cf85b
General - SQF Improvements (#9698)
Co-authored-by: Dystopian <sddex@ya.ru>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-02-04 14:50:24 -03:00

37 lines
783 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Rocko, Ruthberg
* Deploy tactical ladder
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unit] call ace_tacticalladder_fnc_deployTL
*
* Public: No
*/
params ["_unit"];
if (backpack _unit != 'ACE_TacticalLadder_Pack') exitWith {};
removeBackpack _unit;
private _pos = _unit modelToWorld [0,0,0];
private _offset = [0.8, 1] select (_unit call CBA_fnc_getUnitAnim select 0 == "prone");
_pos set [0, (_pos select 0) + (sin getDir _unit) * _offset];
_pos set [1, (_pos select 1) + (cos getDir _unit) * _offset];
_pos set [2, [_unit] call CBA_fnc_realHeight];
private _ladder = "ACE_TacticalLadder" createVehicle _pos;
_ladder setPos _pos;
_ladder setDir getDir _unit;
_unit reveal _ladder;