diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index f7083c9b8c..463a89bc48 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -51,8 +51,12 @@ if (_unit == _attachToVehicle) then { //Self Attachment [_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus); - [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call EFUNC(common,execNextFrame); - _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; + [{ //wait a frame to handle "Do When releasing action menu key" + PARAMS_1(_unit); + if (GVAR(placeAction) != PLACE_WAITING) exitWith {}; + [localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint); + _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; + }, [_unit]] call EFUNC(common,execNextFrame); _actionID = _unit addAction [format ["%1", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}]; @@ -71,7 +75,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"]; PARAMS_2(_args,_pfID); - EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID,_startDiagTime); + EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID); _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); if (cameraView == "EXTERNAL") then { @@ -80,10 +84,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment _virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition); _lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player]; - //Don't allow placing in a bad position or placing right away (click to interact option) - if ((GVAR(placeAction) == PLACE_APPROVE) && {_lineInterection || {ACE_diagTime < (_startDiagTime + 0.333)}}) then { - GVAR(placeAction) = PLACE_WAITING; - }; + //Don't allow placing in a bad position: + if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;}; if ((GVAR(placeAction) != PLACE_WAITING) || {_unit != ACE_player} || @@ -120,5 +122,5 @@ if (_unit == _attachToVehicle) then { //Self Attachment ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up]; }; }; - }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID, ACE_diagTime]] call CBA_fnc_addPerFrameHandler; + }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index c30e767266..9623225df8 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -37,7 +37,7 @@ deleteVehicle _wirecoil; _unit setVariable [QGVAR(wireDeployed), false]; GVAR(deployPFH) = [{ - EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action); + EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit); private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); @@ -73,12 +73,13 @@ GVAR(deployPFH) = [{ { _wireNoGeo animate [_x, _anim]; } foreach WIRE_FAST; -}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler; +}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); - -GVAR(placer) setVariable [QGVAR(Deploy), - [GVAR(placer), "DefaultAction", - {GVAR(deployPFH) != -1}, - {GVAR(placer) setVariable [QGVAR(wireDeployed), true]} -] call EFUNC(common,AddActionEventHandler)]; +[{ //wait a frame to handle "Do When releasing action menu key" option + GVAR(placer) setVariable [QGVAR(Deploy), + [GVAR(placer), "DefaultAction", + {GVAR(deployPFH) != -1}, + {GVAR(placer) setVariable [QGVAR(wireDeployed), true]} + ] call EFUNC(common,AddActionEventHandler)]; +}, _this] call EFUNC(common,execNextFrame); diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 1e1121409b..98fd4b1bd0 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -34,14 +34,17 @@ GVAR(deployPFH) = [{ [localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); -GVAR(placer) setVariable [QGVAR(Deploy), - [GVAR(placer), "DefaultAction", - {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, - {call FUNC(deployConfirm);} -] call EFUNC(common,AddActionEventHandler)]; +[{ //wait a frame to handle "Do When releasing action menu key" option + GVAR(placer) setVariable [QGVAR(Deploy), + [GVAR(placer), "DefaultAction", + {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, + {call FUNC(deployConfirm);} + ] call EFUNC(common,AddActionEventHandler)]; -GVAR(placer) setVariable [QGVAR(Cancel), - [GVAR(placer), "zoomtemp", - {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, - {call FUNC(deployCancel);} -] call EFUNC(common,AddActionEventHandler)]; + GVAR(placer) setVariable [QGVAR(Cancel), + [GVAR(placer), "zoomtemp", + {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, + {call FUNC(deployCancel);} + ] call EFUNC(common,AddActionEventHandler)]; + +}, _this] call EFUNC(common,execNextFrame); diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 103792c851..b8ef914879 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -39,14 +39,17 @@ GVAR(currentAngle) = 0; [localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint); -ACE_player setVariable [QGVAR(Deploy), - [ACE_player, "DefaultAction", - {!isNull GVAR(ladder)}, - {GVAR(ladder) call FUNC(confirmTLdeploy);} -] call EFUNC(common,AddActionEventHandler)]; +[{ //wait a frame to handle "Do When releasing action menu key" option + ACE_player setVariable [QGVAR(Deploy), + [ACE_player, "DefaultAction", + {!isNull GVAR(ladder)}, + {GVAR(ladder) call FUNC(confirmTLdeploy);} + ] call EFUNC(common,AddActionEventHandler)]; -ACE_player setVariable [QGVAR(Cancel), - [ACE_player, "zoomtemp", - {!isNull GVAR(ladder)}, - {GVAR(ladder) call FUNC(cancelTLdeploy);} -] call EFUNC(common,AddActionEventHandler)]; + ACE_player setVariable [QGVAR(Cancel), + [ACE_player, "zoomtemp", + {!isNull GVAR(ladder)}, + {GVAR(ladder) call FUNC(cancelTLdeploy);} + ] call EFUNC(common,AddActionEventHandler)]; + +}, _this] call EFUNC(common,execNextFrame); diff --git a/addons/tripod/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf index ce50d38cf0..bdfb2184e3 100644 --- a/addons/tripod/functions/fnc_adjust.sqf +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -36,8 +36,11 @@ GVAR(adjustPFH) = [{ [localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint); -ACE_player setVariable [QGVAR(Adjust), - [ACE_player, "DefaultAction", - {GVAR(adjustPFH) != -1 && GVAR(adjusting)}, - {GVAR(adjusting) = false;} -] call EFUNC(common,AddActionEventHandler)]; +[{ //wait a frame to handle "Do When releasing action menu key" option + if (!GVAR(adjusting)) exitWith {ERROR("Not Adjusting");}; + ACE_player setVariable [QGVAR(Adjust), + [ACE_player, "DefaultAction", + {GVAR(adjustPFH) != -1 && GVAR(adjusting)}, + {GVAR(adjusting) = false;} + ] call EFUNC(common,AddActionEventHandler)]; +}, _this] call EFUNC(common,execNextFrame);