ACE3/addons/dragging/functions/fnc_resumeCarry.sqf
johnb432 11664b0040
Dragging - Improve featureCamera handling (#9389)
* Update XEH_postInit.sqf

* Update XEH_postInit.sqf

* Update XEH_postInit.sqf

* Different approach

* Updated to new script_component

* fix variable lookup

---------

Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
2023-09-19 23:56:20 -04:00

35 lines
917 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: johnb43
* Adds user input affecting carrying back.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_dragging_fnc_resumeCarry;
*
* Public: No
*/
params ["_unit"];
// If not dragging, don't do anything
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {};
// If action is already present, don't add it again
if (!isNil {_unit getVariable QGVAR(releaseActionID)}) exitWith {};
// Remove drop action
_unit setVariable [QGVAR(releaseActionID), [
_unit, "DefaultAction",
{!isNull ((_this select 0) getVariable [QGVAR(carriedObject), objNull])},
{[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull], true] call FUNC(dropObject_carry)}
] call EFUNC(common,addActionEventHandler)];
// Show mouse hint (done in FUNC(carryObjectPFH))
_unit setVariable [QGVAR(hint), nil];