2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2016-01-23 23:45:59 +00:00
|
|
|
/*
|
|
|
|
* Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support
|
|
|
|
* Cancels trench dig
|
|
|
|
*
|
|
|
|
* Arguments:
|
2016-03-03 16:35:43 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Key <NUMBER>
|
2016-01-23 23:45:59 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2020-04-25 06:41:45 +00:00
|
|
|
* [ACE_player] call ace_trenches_fnc_placeCancel
|
2016-01-23 23:45:59 +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(digPFH) == -1}) exitWith {};
|
2016-01-23 23:45:59 +00:00
|
|
|
|
|
|
|
// enable running again
|
|
|
|
[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set);
|
2017-12-07 17:26:21 +00:00
|
|
|
[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set);
|
2016-01-23 23:45:59 +00:00
|
|
|
|
|
|
|
// delete placement dummy
|
|
|
|
deleteVehicle GVAR(trench);
|
|
|
|
|
|
|
|
// remove digment pfh
|
|
|
|
[GVAR(digPFH)] call CBA_fnc_removePerFrameHandler;
|
|
|
|
GVAR(digPFH) = -1;
|
|
|
|
|
|
|
|
// remove mouse button actions
|
|
|
|
call EFUNC(interaction,hideMouseHint);
|
|
|
|
|
|
|
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(Dig), -1]] call EFUNC(common,removeActionEventHandler);
|
|
|
|
|
2016-02-04 20:42:12 +00:00
|
|
|
_unit setVariable [QGVAR(isPlacing), false, true];
|