This commit is contained in:
commy2 2015-03-25 14:32:36 +01:00
parent e1b5b96a7e
commit 0c8e8236dd
2 changed files with 12 additions and 8 deletions

View File

@ -7,6 +7,11 @@ _unit = _this select 0 select 0;
_target = _this select 0 select 1;
_timeOut = _this select 0 select 2;
// handle aborting carry
if (_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// same as dragObjectPFH, checks if object is deleted or dead.
if !([_target] call EFUNC(common,isAlive)) then {
[_unit, _target] call FUNC(dropObject);
@ -15,10 +20,7 @@ if !([_target] call EFUNC(common,isAlive)) then {
// timeout. Done with lifting object. Start carrying process.
if (time > _timeOut) exitWith {
// handles aborting carry
if (_unit getVariable [QGVAR(isCarrying), false]) then {
[_unit, _target] call FUNC(carryObject);
};
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

View File

@ -7,6 +7,11 @@ _unit = _this select 0 select 0;
_target = _this select 0 select 1;
_timeOut = _this select 0 select 2;
// handle aborting drag
if (_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// same as dragObjectPFH, checks if object is deleted or dead.
if !([_target] call EFUNC(common,isAlive)) then {
[_unit, _target] call FUNC(dropObject);
@ -26,10 +31,7 @@ if (time > _timeOut) exitWith {
// unit is ready to start dragging
if (animationState _unit in DRAG_ANIMATIONS) exitWith {
// handles aborting dragging
if (_unit getVariable [QGVAR(isDragging), false]) then {
[_unit, _target] call FUNC(dragObject);
};
[_this select 1] call CBA_fnc_removePerFrameHandler;
};