diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index c22b84ffb4..801f3a6a91 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -6,3 +6,15 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}]; }; + +[QGVAR(makeDummyEH), { + _this call FUNC(makeDummy); +}] call EFUNC(common,addEventHandler); + +[QGVAR(rearmEntireVehicleSuccessLocalEH), { + _this call FUNC(rearmEntireVehicleSuccessLocal); +}] call EFUNC(common,addEventHandler); + +[QGVAR(rearmSuccessLocalEH), { + _this call FUNC(rearmSuccessLocal); +}] call EFUNC(common,addEventHandler); diff --git a/addons/rearm/functions/fnc_pickUpAmmo.sqf b/addons/rearm/functions/fnc_pickUpAmmo.sqf index e8c2b1fe84..3b3bbb9034 100644 --- a/addons/rearm/functions/fnc_pickUpAmmo.sqf +++ b/addons/rearm/functions/fnc_pickUpAmmo.sqf @@ -23,6 +23,6 @@ if !(isNull _attachedDummy) exitWith {}; _dummy attachTo [_unit, [0,1,0], "pelvis"]; { - [[_dummy, [[-1,0,0],[0,0,1]]], QFUNC(makeDummy), _x] call EFUNC(common,execRemoteFnc); + [QGVAR(makeDummyEH), _x, [_dummy, [[-1,0,0],[0,0,1]]]] call EFUNC(common,objectEvent); } count (position _unit nearObjects ["CAManBase", 100]); _unit setVariable [QGVAR(dummy), _dummy]; diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf index 6b71a3b66e..ccce6eec57 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf @@ -24,10 +24,9 @@ if (isServer) then { { _turretOwnerID = _vehicle turretOwner _x; if (_turretOwnerID == 0) then { - [[_truck, _vehicle, _x], QFUNC(rearmEntireVehicleSuccessLocal), _truck] call EFUNC(common,execRemoteFnc); + [QGVAR(rearmEntireVehicleSuccessLocalEH), _truck, [_truck, _vehicle, _x]] call EFUNC(common,objectEvent); } else { - EGVAR(common,remoteFnc) = [[_truck, _vehicle, _x], QFUNC(rearmEntireVehicleSuccessLocal), 0]; - _turretOwnerID publicVariableClient QEGVAR(common,remoteFnc); + [QGVAR(rearmEntireVehicleSuccessLocalEH), _turretOwnerID, [_truck, _vehicle, _x]] call EFUNC(common,targetEvent); }; } count REARM_TURRET_PATHS; } else { diff --git a/addons/rearm/functions/fnc_rearmSuccess.sqf b/addons/rearm/functions/fnc_rearmSuccess.sqf index 28622332a9..7db711edfd 100644 --- a/addons/rearm/functions/fnc_rearmSuccess.sqf +++ b/addons/rearm/functions/fnc_rearmSuccess.sqf @@ -33,10 +33,9 @@ if (local _unit) then { if (isServer) then { private _turretOwnerID = _vehicle turretOwner _turretPath; if (_turretOwnerID == 0) then { - [_this, QFUNC(rearmSuccessLocal), _vehicle] call EFUNC(common,execRemoteFnc); + [QGVAR(rearmSuccessLocalEH), _vehicle, _this] call EFUNC(common,objectEvent); } else { - EGVAR(common,remoteFnc) = [_this, QFUNC(rearmSuccessLocal), 0]; - _turretOwnerID publicVariableClient QEGVAR(common,remoteFnc); + [QGVAR(rearmSuccessLocalEH), _turretOwnerID, _this] call EFUNC(common,targetEvent); }; } else { [_this, QFUNC(rearmSuccess), 1] call EFUNC(common,execRemoteFnc);