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:
|
2015-08-09 13:20:50 +00:00
|
|
|
* [_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
|
|
|
private ["_player", "_draggedObject", "_carriedObject"];
|
2015-03-24 18:07:39 +00:00
|
|
|
|
2015-08-09 12:53:13 +00:00
|
|
|
params ["_unit"];
|
2015-03-24 18:07:39 +00:00
|
|
|
|
|
|
|
_player = ACE_player;
|
|
|
|
|
2015-03-25 12:32:59 +00:00
|
|
|
if (_player getVariable [QGVAR(isDragging), false]) then {
|
2015-03-24 18:07:39 +00:00
|
|
|
|
2015-03-25 12:32:59 +00:00
|
|
|
_draggedObject = _player getVariable [QGVAR(draggedObject), objNull];
|
|
|
|
|
|
|
|
// handle falling unconscious
|
|
|
|
if (_unit == _player) then {
|
|
|
|
[_unit, _draggedObject] call FUNC(dropObject);
|
|
|
|
};
|
|
|
|
|
|
|
|
// handle waking up dragged unit
|
2015-04-17 18:33:13 +00:00
|
|
|
//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 {
|
|
|
|
|
|
|
|
_carriedObject = _player getVariable [QGVAR(carriedObject), objNull];
|
|
|
|
|
|
|
|
// handle falling unconscious
|
|
|
|
if (_unit == _player) then {
|
|
|
|
[_unit, _carriedObject] call FUNC(dropObject_carry);
|
|
|
|
};
|
|
|
|
|
|
|
|
// handle waking up dragged unit
|
2015-04-17 18:33:13 +00:00
|
|
|
//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
|
|
|
};
|