ACE3/addons/sandbag/functions/fnc_deployConfirm.sqf

58 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
2015-06-02 17:30:50 +00:00
/*
* Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support
2015-06-02 17:30:50 +00:00
* Confirms sandbag deployment
*
* Arguments:
* 0: unit <OBJECT>
2015-06-02 17:30:50 +00:00
*
* Return Value:
* None
*
* Example:
* [ACE_player] call ace_sandbag_fnc_deployConfirm
2015-06-02 17:30:50 +00:00
*
* Public: No
*/
params ["_unit"];
2015-06-02 17:30:50 +00:00
// enable running again
[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
2015-06-02 17:30:50 +00:00
// remove sandbag from inventory
_unit removeItem "ACE_Sandbag_empty";
2015-06-02 17:30:50 +00:00
// delete placement dummy and create real sandbag
[{
if (isNull GVAR(sandBag)) exitWith {};
2015-06-02 17:30:50 +00:00
params ["_unit"];
2015-06-02 17:30:50 +00:00
private _position = getPosASL GVAR(sandBag);
private _direction = getDir GVAR(sandBag);
2015-08-08 00:00:00 +00:00
deleteVehicle GVAR(sandBag);
2015-08-08 00:00:00 +00:00
private _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"];
_sandBag setPosASL _position;
_sandBag setDir _direction;
2015-08-08 00:00:00 +00:00
2015-06-02 17:30:50 +00:00
GVAR(sandBag) = objNull;
}, [_unit], 1] call CBA_fnc_waitAndExecute;
// remove deployment pfh
[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler;
GVAR(deployPFH) = -1;
// remove mouse button actions
call EFUNC(interaction,hideMouseHint);
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
// play animation
2016-07-12 14:16:01 +00:00
[_unit, "PutDown"] call EFUNC(common,doGesture);
_unit setVariable [QGVAR(isDeploying), false, true];