2015-08-09 12:53:13 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
2015-08-09 13:20:50 +00:00
|
|
|
* Handle the animaion for a Unit for Dragging Module
|
2015-08-09 12:53:13 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
2015-08-09 13:20:50 +00:00
|
|
|
* 1: animaion <STRING>
|
2015-08-09 12:53:13 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [_unit, "amovpercmstpsnonwnondnon"] call ace_dragging_fnc_handleAnimChanged;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-03-18 14:42:33 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-01-28 18:52:53 +00:00
|
|
|
params ["_unit", "_anim"];
|
2015-03-18 14:42:33 +00:00
|
|
|
|
|
|
|
if (_unit getVariable [QGVAR(isDragging), false]) then {
|
|
|
|
|
|
|
|
// drop dragged object when not in valid animation
|
|
|
|
if !(_anim in DRAG_ANIMATIONS) then {
|
2016-01-28 18:52:53 +00:00
|
|
|
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
|
2015-03-18 14:42:33 +00:00
|
|
|
|
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 {
|
|
|
|
|
2015-03-29 18:46:29 +00:00
|
|
|
// drop carried object when not standing; also some exceptions when picking up crate
|
|
|
|
if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
|
2016-01-28 18:52:53 +00:00
|
|
|
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
|
2015-03-18 14:42:33 +00:00
|
|
|
|
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
|
|
|
};
|
|
|
|
};
|