ACE3/addons/dragging/functions/fnc_handleKilled.sqf

34 lines
689 B
Plaintext
Raw Normal View History

2015-08-09 12:53:13 +00:00
/*
* Author: commy2
*
* Handle death of the dragger
2015-08-09 12:53:13 +00:00
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unit] call ace_dragging_fnc_handleKilled;
*
* Public: No
*/
2015-03-18 14:42:33 +00:00
#include "script_component.hpp"
2015-08-09 12:53:13 +00:00
params ["_unit"];
2015-03-18 14:42:33 +00:00
if (_unit getVariable [QGVAR(isDragging), false]) then {
private "_draggedObject";
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
[_unit, _draggedObject] call FUNC(dropObject);
};
if (_unit getVariable [QGVAR(isCarrying), false]) then {
private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
[_unit, _carriedObject] call FUNC(dropObject_carry);
};