2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-06-02 17:30:50 +00:00
|
|
|
/*
|
2015-09-26 01:16:55 +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:
|
2015-09-26 01:16:55 +00:00
|
|
|
* 0: unit <OBJECT>
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-09-26 01:16:55 +00:00
|
|
|
* [ACE_player] call ace_sandbag_fnc_deployConfirm
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit"];
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// enable running again
|
2024-08-12 13:15:09 +00:00
|
|
|
[_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
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// remove sandbag from inventory
|
|
|
|
_unit removeItem "ACE_Sandbag_empty";
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// delete placement dummy and create real sandbag
|
|
|
|
[{
|
|
|
|
if (isNull GVAR(sandBag)) exitWith {};
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit"];
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2017-03-15 15:11:37 +00:00
|
|
|
private _position = getPosASL GVAR(sandBag);
|
|
|
|
private _direction = getDir GVAR(sandBag);
|
2015-08-08 00:00:00 +00:00
|
|
|
|
2015-06-04 09:13:12 +00:00
|
|
|
deleteVehicle GVAR(sandBag);
|
2015-08-08 00:00:00 +00:00
|
|
|
|
2017-03-15 15:11:37 +00:00
|
|
|
private _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"];
|
2015-06-04 09:13:12 +00:00
|
|
|
_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;
|
2016-05-22 13:27:24 +00:00
|
|
|
}, [_unit], 1] call CBA_fnc_waitAndExecute;
|
2015-09-26 01:16:55 +00:00
|
|
|
|
|
|
|
// 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);
|
2015-09-26 01:16:55 +00:00
|
|
|
|
|
|
|
_unit setVariable [QGVAR(isDeploying), false, true];
|