2015-06-12 21:54:51 +00:00
|
|
|
/*
|
2015-09-26 01:16:55 +00:00
|
|
|
* Author: Rocko, Ruthberg, commy2
|
2015-06-12 21:54:51 +00:00
|
|
|
* Confirm tactical ladder deployment
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-09-26 01:16:55 +00:00
|
|
|
* 0: unit <OBJECT>
|
|
|
|
* 1: ladder <OBJECT>
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-07 06:19:15 +00:00
|
|
|
* Success <BOOL>
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-07 06:19:15 +00:00
|
|
|
* [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-06-03 18:27:52 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit", "_ladder"];
|
|
|
|
|
|
|
|
// enable running again
|
2016-01-19 15:34:59 +00:00
|
|
|
[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set);
|
2015-06-03 18:27:52 +00:00
|
|
|
|
2015-06-12 20:45:41 +00:00
|
|
|
private ["_pos1", "_pos2"];
|
2015-06-12 21:54:51 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
_pos1 = getPosASL _ladder;
|
|
|
|
_pos2 = AGLToASL (_ladder modelToWorld (_ladder selectionPosition "check2"));
|
|
|
|
|
|
|
|
if (lineIntersects [_pos1, _pos2, _ladder]) exitWith {false};
|
2015-06-03 18:27:52 +00:00
|
|
|
|
|
|
|
detach _ladder;
|
2015-09-26 01:16:55 +00:00
|
|
|
|
|
|
|
// remove mouse buttons and hint
|
|
|
|
call EFUNC(interaction,hideMouseHint);
|
|
|
|
|
|
|
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
|
|
|
|
|
2015-06-12 21:54:51 +00:00
|
|
|
GVAR(ladder) = objNull;
|
2015-06-03 18:27:52 +00:00
|
|
|
|
2015-06-12 21:54:51 +00:00
|
|
|
true
|