mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Dragging - Fix dragging breaking via keybind (#10261)
Fixed dragging breaking via keybind
This commit is contained in:
parent
db7b78c068
commit
3b10396d3b
@ -48,9 +48,6 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
|
|
||||||
[QEGVAR(common,setDir), [_target, _direction], _target] call CBA_fnc_targetEvent;
|
[QEGVAR(common,setDir), [_target, _direction], _target] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
_unit setVariable [QGVAR(isCarrying), true, true];
|
|
||||||
_unit setVariable [QGVAR(carriedObject), _target, true];
|
|
||||||
|
|
||||||
// Add drop action
|
// Add drop action
|
||||||
_unit setVariable [QGVAR(releaseActionID), [
|
_unit setVariable [QGVAR(releaseActionID), [
|
||||||
_unit, "DefaultAction",
|
_unit, "DefaultAction",
|
||||||
|
@ -49,9 +49,6 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
[_target, "AinjPpneMrunSnonWnonDb_still", 0] call EFUNC(common,doAnimation);
|
[_target, "AinjPpneMrunSnonWnonDb_still", 0] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
|
|
||||||
_unit setVariable [QGVAR(isDragging), true, true];
|
|
||||||
_unit setVariable [QGVAR(draggedObject), _target, true];
|
|
||||||
|
|
||||||
// Add drop action
|
// Add drop action
|
||||||
GVAR(unit) = _unit;
|
GVAR(unit) = _unit;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
// Prevents dragging and carrying at the same time
|
// Prevents dragging and carrying at the same time
|
||||||
_unit setVariable [QGVAR(isCarrying), true, true];
|
_unit setVariable [QGVAR(isCarrying), true, true];
|
||||||
|
|
||||||
// Required for aborting animation
|
// Required for aborting (animation & keybind)
|
||||||
_unit setVariable [QGVAR(carriedObject), _target, true];
|
_unit setVariable [QGVAR(carriedObject), _target, true];
|
||||||
|
|
||||||
[LINKFUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
|
[LINKFUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
@ -53,10 +53,9 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
// Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time
|
// Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time
|
||||||
if (CBA_missionTime > _timeOut) exitWith {
|
if (CBA_missionTime > _timeOut) exitWith {
|
||||||
TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime);
|
TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime);
|
||||||
_idPFH call CBA_fnc_removePerFrameHandler;
|
[_unit, _target] call FUNC(dropObject_carry);
|
||||||
|
|
||||||
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
|
_idPFH call CBA_fnc_removePerFrameHandler;
|
||||||
[_unit, _carriedObject] call FUNC(dropObject_carry);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wait for the unit to stand up
|
// Wait for the unit to stand up
|
||||||
|
@ -99,6 +99,9 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
// Prevents dragging and carrying at the same time
|
// Prevents dragging and carrying at the same time
|
||||||
_unit setVariable [QGVAR(isDragging), true, true];
|
_unit setVariable [QGVAR(isDragging), true, true];
|
||||||
|
|
||||||
|
// Required for aborting (keybind)
|
||||||
|
_unit setVariable [QGVAR(draggedObject), _target, true];
|
||||||
|
|
||||||
[LINKFUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
|
[LINKFUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
// Disable collisions by setting the physx mass to almost zero
|
// Disable collisions by setting the physx mass to almost zero
|
||||||
|
@ -43,11 +43,9 @@ if (!alive _target || {_unit distance _target > 10}) exitWith {
|
|||||||
// Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time
|
// Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time
|
||||||
if (CBA_missionTime > _timeOut) exitWith {
|
if (CBA_missionTime > _timeOut) exitWith {
|
||||||
TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime);
|
TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime);
|
||||||
_idPFH call CBA_fnc_removePerFrameHandler;
|
[_unit, _target] call FUNC(dropObject);
|
||||||
|
|
||||||
// Drop if in timeout
|
_idPFH call CBA_fnc_removePerFrameHandler;
|
||||||
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
|
|
||||||
[_unit, _draggedObject] call FUNC(dropObject);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Unit is ready to start dragging
|
// Unit is ready to start dragging
|
||||||
|
Loading…
Reference in New Issue
Block a user