2015-01-12 09:48:26 +00:00
|
|
|
/*
|
2015-02-02 08:35:17 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Approves placement of the explosive, releases the placement object for it
|
|
|
|
* to settle in a location suitable for the explosive to be created.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ACE_Explosives_fnc_place_Approve;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-13 21:21:31 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-12 09:48:26 +00:00
|
|
|
if (GVAR(pfeh_running)) then {
|
2015-04-06 20:20:11 +00:00
|
|
|
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);
|
|
|
|
GVAR(pfeh_running) = false;
|
2015-01-12 09:48:26 +00:00
|
|
|
};
|
2015-04-29 05:05:02 +00:00
|
|
|
private ["_setup", "_player", "_dir"];
|
2015-01-12 09:48:26 +00:00
|
|
|
_setup = GVAR(Setup);
|
|
|
|
GVAR(Setup) = objNull;
|
2015-01-12 20:39:37 +00:00
|
|
|
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus);
|
2015-02-20 01:28:16 +00:00
|
|
|
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
|
2015-04-09 19:48:27 +00:00
|
|
|
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
2015-01-12 09:48:26 +00:00
|
|
|
GVAR(placer) = objNull;
|
|
|
|
_player = ACE_player;
|
2015-01-15 19:13:12 +00:00
|
|
|
call EFUNC(interaction,hideMouseHint);
|
2015-02-19 13:59:14 +00:00
|
|
|
if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith {
|
2015-04-06 20:20:11 +00:00
|
|
|
deleteVehicle _setup;
|
2015-02-19 13:59:14 +00:00
|
|
|
};
|
|
|
|
_dir = (getDir _setup);
|
|
|
|
if (_dir > 180) then {
|
2015-04-06 20:20:11 +00:00
|
|
|
_dir = _dir - 180;
|
2015-02-19 13:59:14 +00:00
|
|
|
} else {
|
2015-04-06 20:20:11 +00:00
|
|
|
_dir = 180 + _dir;
|
2015-02-19 13:59:14 +00:00
|
|
|
};
|
|
|
|
_setup setVariable [QGVAR(Direction), _dir];
|
|
|
|
_player setVariable [QGVAR(PlantingExplosive), true];
|
2015-04-09 19:48:27 +00:00
|
|
|
[{_this setVariable [QGVAR(PlantingExplosive), false]}, _player, 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
2015-02-19 22:44:54 +00:00
|
|
|
_setup addEventHandler ["EpeContactStart", FUNC(onLanded)];
|
2015-02-19 13:59:14 +00:00
|
|
|
_setup enableSimulationGlobal true;
|
2015-05-19 18:29:23 +00:00
|
|
|
_player playActionNow "PutDown";
|
2015-03-31 17:26:38 +00:00
|
|
|
_player removeMagazine (_setup getVariable [QGVAR(Class), ""]);
|