ACE3/addons/sandbag/functions/fnc_deployCancel.sqf

41 lines
1.1 KiB
Plaintext
Raw Normal View History

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
* Cancels sandbag deployment
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Key <NUMBER>
2015-06-02 17:30:50 +00:00
*
* Return Value:
* None
*
* Example:
* [ACE_player] call ace_sandbag_fnc_deployCancel
2015-06-02 17:30:50 +00:00
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_key"];
if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {};
2015-06-02 17:30:50 +00:00
// enable running again
2016-01-19 15:34:59 +00:00
[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set);
[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set);
2015-06-02 17:30:50 +00:00
// delete placement dummy
deleteVehicle GVAR(sandBag);
2015-06-02 17:30:50 +00:00
// remove deployment pfh
[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler;
GVAR(deployPFH) = -1;
2015-06-02 17:30:50 +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
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler);
_unit setVariable [QGVAR(isDeploying), false, true];