ACE3/addons/dragging/XEH_clientInit.sqf
2015-03-17 15:42:25 +01:00

28 lines
988 B
Plaintext

// by PabstMirror, commy2
#include "script_component.hpp"
GVAR(currentHeightChange) = 0;
//[{_this call DFUNC(handleScrollWheel)}] call FUNC(common,addScrollWheelEventHandler);
if (isNil QGVAR(maxWeight)) then {
GVAR(maxWeight) = 800;
};
["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition);
["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
// release object on player change. This does work when returning to lobby, but not when hard disconnecting.
["playerChanged", {
private ["_newPlayer", "_oldPlayer"];
_newPlayer = _this select 0;
_oldPlayer = _this select 1;
{
if (_x getVariable [QGVAR(isDragging), false]) then {
[_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
};
} forEach [_newPlayer, _oldPlayer];
}] call EFUNC(common,addEventhandler);