ACE3/addons/dragging/functions/fnc_handleKilled.sqf
johnb432 dbe372cb48
Dragging - Improve code (#9271)
* Code cleanup

* Moved keybinds to initKeybinds.sqf

* Update addons/dragging/initKeybinds.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/dragging/functions/fnc_carryObject.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/dragging/functions/fnc_getWeight.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Rephrasing and adjustments for dragging

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2023-07-24 02:07:37 +03:00

32 lines
677 B
Plaintext

#include "script_component.hpp"
/*
* Author: commy2
* Handle death of the dragger/carrier.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ace_dragging_fnc_handleKilled;
*
* Public: No
*/
params ["_unit"];
TRACE_1("params",_unit);
if (_unit getVariable [QGVAR(isDragging), false]) then {
private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull];
[_unit, _draggedObject] call FUNC(dropObject);
};
if (_unit getVariable [QGVAR(isCarrying), false]) then {
private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];
[_unit, _carriedObject] call FUNC(dropObject_carry);
};