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-01-13 10:13:43 +00:00
|
|
|
[QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);
|
2015-01-12 09:48:26 +00:00
|
|
|
GVAR(pfeh_running) = false;
|
|
|
|
};
|
|
|
|
private ["_mag", "_setup", "_player"];
|
|
|
|
_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);
|
|
|
|
[ACE_player, "MenuBack", 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 {
|
|
|
|
deleteVehicle _setup;
|
|
|
|
};
|
|
|
|
_dir = (getDir _setup);
|
|
|
|
if (_dir > 180) then {
|
|
|
|
_dir = _dir - 180;
|
|
|
|
} else {
|
|
|
|
_dir = 180 + _dir;
|
|
|
|
};
|
|
|
|
_setup setVariable [QGVAR(Direction), _dir];
|
|
|
|
_player setVariable [QGVAR(PlantingExplosive), true];
|
2015-02-19 22:44:54 +00:00
|
|
|
_setup addEventHandler ["EpeContactStart", FUNC(onLanded)];
|
2015-02-19 13:59:14 +00:00
|
|
|
_setup enableSimulationGlobal true;
|
|
|
|
_player playActionNow "MedicOther";
|
2015-03-31 17:26:38 +00:00
|
|
|
_player removeMagazine (_setup getVariable [QGVAR(Class), ""]);
|