ACE3/addons/dragging/functions/fnc_handleUnconscious.sqf

53 lines
1.1 KiB
Plaintext
Raw Normal View History

2015-08-09 12:53:13 +00:00
/*
* Author: commy2
* Handle the Unconscious of a Unit while Dragging
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unit] call ace_dragging_fnc_handleUnconscious;
2015-08-09 12:53:13 +00:00
*
* Public: No
*/
2015-03-24 18:07:39 +00:00
#include "script_component.hpp"
2015-08-09 12:53:13 +00:00
params ["_unit"];
2015-03-24 18:07:39 +00:00
2016-01-28 18:52:53 +00:00
private _player = ACE_player;
2015-03-24 18:07:39 +00:00
2015-03-25 12:32:59 +00:00
if (_player getVariable [QGVAR(isDragging), false]) then {
2015-03-24 18:07:39 +00:00
2016-01-28 18:52:53 +00:00
private _draggedObject = _player getVariable [QGVAR(draggedObject), objNull];
2015-03-25 12:32:59 +00:00
// handle falling unconscious
if (_unit == _player) then {
[_unit, _draggedObject] call FUNC(dropObject);
};
// handle waking up dragged unit
//if (_unit == _draggedObject) then {
// [_player, _draggedObject] call FUNC(dropObject);
//};
2015-03-24 18:07:39 +00:00
};
2015-03-25 12:32:59 +00:00
if (_player getVariable [QGVAR(isCarrying), false]) then {
2016-01-28 18:52:53 +00:00
private _carriedObject = _player getVariable [QGVAR(carriedObject), objNull];
2015-03-25 12:32:59 +00:00
// handle falling unconscious
if (_unit == _player) then {
[_unit, _carriedObject] call FUNC(dropObject_carry);
};
// handle waking up dragged unit
//if (_unit == _carriedObject) then {
// [_player, _carriedObject] call FUNC(dropObject_carry);
//};
2015-03-25 12:32:59 +00:00
2015-03-24 18:07:39 +00:00
};