2015-03-18 14:42:33 +00:00
|
|
|
// by commy2
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit", "_anim"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
_anim = _this select 1;
|
|
|
|
|
|
|
|
if (_unit getVariable [QGVAR(isDragging), false]) then {
|
|
|
|
|
|
|
|
// drop dragged object when not in valid animation
|
|
|
|
if !(_anim in DRAG_ANIMATIONS) then {
|
|
|
|
private "_draggedObject";
|
|
|
|
_draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
|
|
|
|
|
2015-03-22 16:12:14 +00:00
|
|
|
if (!isNull _draggedObject) then {
|
|
|
|
[_unit, _draggedObject] call FUNC(dropObject);
|
|
|
|
};
|
2015-03-18 14:42:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
if (_unit getVariable [QGVAR(isCarrying), false]) then {
|
|
|
|
|
|
|
|
// drop carried object when not standing
|
|
|
|
if (stance _unit != "STAND") then {
|
|
|
|
private "_carriedObject";
|
|
|
|
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
|
|
|
|
|
2015-03-22 16:12:14 +00:00
|
|
|
if (!isNull _carriedObject) then {
|
|
|
|
[_unit, _carriedObject] call FUNC(dropObject_carry);
|
|
|
|
};
|
2015-03-18 14:42:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|