mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix: could drag and carry object at the same time
This commit is contained in:
parent
c243513227
commit
11bb1a050a
@ -13,7 +13,9 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
|
|||||||
private "_draggedObject";
|
private "_draggedObject";
|
||||||
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
|
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
|
||||||
|
|
||||||
[_unit, _draggedObject] call FUNC(dropObject);
|
if (!isNull _draggedObject) then {
|
||||||
|
[_unit, _draggedObject] call FUNC(dropObject);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -25,7 +27,9 @@ if (_unit getVariable [QGVAR(isCarrying), false]) then {
|
|||||||
private "_carriedObject";
|
private "_carriedObject";
|
||||||
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
|
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
|
||||||
|
|
||||||
[_unit, _carriedObject] call FUNC(dropObject_carry);
|
if (!isNull _carriedObject) then {
|
||||||
|
[_unit, _carriedObject] call FUNC(dropObject_carry);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -40,4 +40,7 @@ _unit selectWeapon primaryWeapon _unit;
|
|||||||
// can't play action that depends on weapon if it was added the same frame
|
// can't play action that depends on weapon if it was added the same frame
|
||||||
[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame);
|
[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame);
|
||||||
|
|
||||||
|
// prevents draging and carrying at the same time
|
||||||
|
_unit setVariable [QGVAR(isDragging), true, true];
|
||||||
|
|
||||||
[FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler;
|
[FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
@ -10,6 +10,9 @@ _timeOut = _this select 0 select 2;
|
|||||||
// timeout. Do nothing. Quit. time, because anim length is linked to ingame time.
|
// timeout. Do nothing. Quit. time, because anim length is linked to ingame time.
|
||||||
if (time > _timeOut) exitWith {
|
if (time > _timeOut) exitWith {
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
|
|
||||||
|
// re-enable everything
|
||||||
|
_unit setVariable [QGVAR(isDragging), false, true];
|
||||||
};
|
};
|
||||||
|
|
||||||
// unit is ready to start dragging
|
// unit is ready to start dragging
|
||||||
|
Loading…
Reference in New Issue
Block a user