Explosives: cancel placement when opening interact

"zoomtemp" doesn't work for me, so this gives an additional way to
cancel.  It was also possible to start planting multiple explosives.
made a small change to make QGVAR(PlantingExplosive) always reset
This commit is contained in:
PabstMirror 2015-04-09 14:48:27 -05:00
parent e836d2627d
commit 253614d442
3 changed files with 9 additions and 2 deletions

View File

@ -20,6 +20,13 @@ GVAR(Setup) = objNull;
GVAR(pfeh_running) = false;
GVAR(CurrentSpeedDial) = 0;
//Cancel placement if interact menu opened
["interactMenuOpened", {
if (GVAR(pfeh_running) && {!isNull (GVAR(Setup))}) then {
call FUNC(place_Cancel)
};
}] call EFUNC(common,addEventHandler);
[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler);
player addEventHandler ["Killed", {
private "_deadman";

View File

@ -27,7 +27,6 @@ if (!isNull _hitTarget && {_hitTarget isKindOf "AllVehicles"}) then {
[{
EXPLODE_2_PVT(_this,_player,_explosive);
private "_pos";
_player setVariable [QGVAR(PlantingExplosive), false];
if (surfaceIsWater _pos) then {
_pos = getPosASL _explosive;
_explosive setPosASL _pos;

View File

@ -24,7 +24,7 @@ _setup = GVAR(Setup);
GVAR(Setup) = objNull;
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus);
[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);
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
GVAR(placer) = objNull;
_player = ACE_player;
call EFUNC(interaction,hideMouseHint);
@ -39,6 +39,7 @@ if (_dir > 180) then {
};
_setup setVariable [QGVAR(Direction), _dir];
_player setVariable [QGVAR(PlantingExplosive), true];
[{_this setVariable [QGVAR(PlantingExplosive), false]}, _player, 1.5, 0.5] call EFUNC(common,waitAndExecute);
_setup addEventHandler ["EpeContactStart", FUNC(onLanded)];
_setup enableSimulationGlobal true;
_player playActionNow "MedicOther";