2021-10-12 09:33:05 +00:00
|
|
|
#include "script_component.hpp"
|
2024-02-05 18:54:51 +00:00
|
|
|
|
2021-10-12 09:33:05 +00:00
|
|
|
["MouseButtonUp", LINKFUNC(onMouseButtonUp)] call CBA_fnc_addDisplayHandler;
|
|
|
|
GVAR(mouseLeft) = false;
|
|
|
|
GVAR(mouseRight) = false;
|
2023-11-11 00:16:11 +00:00
|
|
|
GVAR(blockFireEHID) = -1;
|
2021-10-12 09:33:05 +00:00
|
|
|
|
2024-02-05 18:54:51 +00:00
|
|
|
[QGVAR(ropeAttachTo), {
|
|
|
|
params ["_child", "_relativeAttachPos", "_rope", "_helper"];
|
|
|
|
TRACE_4("ropeAttachTo",_child,_relativeAttachPos,_rope,_helper);
|
|
|
|
_helper ropeDetach _rope;
|
|
|
|
[_child, _relativeAttachPos] ropeAttachTo _rope;
|
|
|
|
deleteVehicle _helper;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
[QGVAR(attachVehicles), LINKFUNC(attachVehicles)] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(detachChild), LINKFUNC(detachChild)] call CBA_fnc_addEventHandler;
|
2021-10-12 09:33:05 +00:00
|
|
|
|
2024-02-05 18:54:51 +00:00
|
|
|
if (!isServer) exitWith {};
|
|
|
|
|
|
|
|
[QGVAR(cleanupParent), {
|
|
|
|
params ["_parent"];
|
|
|
|
TRACE_1("cleanupParent",_parent);
|
|
|
|
_parent removeEventHandler ["RopeBreak", _parent getVariable [QGVAR(RopeBreakEHID), -1]];
|
|
|
|
_parent setVariable [QGVAR(RopeBreakEHID), -1];
|
|
|
|
private _parentParentHooks = _parent getVariable [QGVAR(parentHooks), []];
|
|
|
|
if (_parentParentHooks isEqualTo []) then {
|
|
|
|
TRACE_1("remove Deleted EH",_parent);
|
|
|
|
_parent removeEventHandler ["Deleted", _parent getVariable [QGVAR(DeletedEHID), -1]];
|
|
|
|
_parent setVariable [QGVAR(DeletedEHID), -1];
|
|
|
|
};
|
2021-10-12 09:33:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2024-02-05 18:54:51 +00:00
|
|
|
|
|
|
|
addMissionEventHandler ["PlayerConnected", {
|
|
|
|
if (GVAR(allChildren) isEqualTo []) exitWith {};
|
|
|
|
params ["", "", "", "_jip", "_owner"];
|
|
|
|
if (!_jip) exitWith {};
|
|
|
|
TRACE_2("pushing children",_owner,GVAR(allChildren));
|
|
|
|
[QGVAR(setTowParentAllChildren), [GVAR(allChildren)], _owner] call CBA_fnc_ownerEvent;
|
|
|
|
}];
|