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
|
|
|
* Cancels sandbag deployment
|
|
|
|
*
|
|
|
|
* Arguments:
|
2016-03-03 16:35:43 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Key <NUMBER>
|
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_deployCancel
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-03-03 16:35:43 +00:00
|
|
|
params ["_unit", "_key"];
|
|
|
|
|
2016-03-06 11:06:17 +00:00
|
|
|
if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {};
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// enable running again
|
2016-01-19 15:34:59 +00:00
|
|
|
[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set);
|
2017-12-07 17:26:21 +00:00
|
|
|
[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set);
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// delete placement dummy
|
|
|
|
deleteVehicle GVAR(sandBag);
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// remove deployment pfh
|
|
|
|
[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler;
|
|
|
|
GVAR(deployPFH) = -1;
|
2015-06-02 17:30:50 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
// remove mouse button actions
|
2015-06-02 17:30:50 +00:00
|
|
|
call EFUNC(interaction,hideMouseHint);
|
2015-06-02 18:01:48 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
|
|
|
|
[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler);
|
2015-06-04 09:13:12 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
_unit setVariable [QGVAR(isDeploying), false, true];
|