diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 58e674dd8d..f188025d7b 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -158,6 +158,9 @@ if (isServer) then { ["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler); }; +["setVectorDirAndUp", {(_this select 0) setVectorDirAndUp (_this select 1)}] call FUNC(addEventHandler); +["setHitPointDamage", {(_this select 0) setHitPointDamage (_this select 1)}] call FUNC(addEventHandler); + ////////////////////////////////////////////////// // Set up remote execution diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf index 151f08d80b..5078d808a2 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -6,19 +6,6 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}]; }; -// @todo move to common? -[QGVAR(setVectorDirAndUp), { - params ["_vehicle", "_vectorDirAndUp"]; - - if (local _vehicle) then { - (_this select 0) setVectorDirAndUp (_this select 1) - }; -}] call EFUNC(common,addEventHandler); - -[QGVAR(setVehicleHitPointDamage), { - (_this select 0) setHitPointDamage (_this select 1); -}] call EFUNC(common,addEventHandler); - [QGVAR(resetLocal), { _this call FUNC(resetLocal); }] call EFUNC(common,addEventHandler); diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index ec99f51fa4..ae707a5718 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -119,7 +119,7 @@ _endPosTestOffset set [2, (_startingOffset select 2)]; }; }; }; - [QGVAR(setVectorDirAndUp), [_nozzle, _dirAndUp]] call EFUNC(common,globalEvent); + ["setVectorDirAndUp", _nozzle, [_nozzle, _dirAndUp]] call EFUNC(common,targetEvent); _nozzle setVariable [QGVAR(sink), _target, true]; _nozzle setVariable [QGVAR(isConnected), true, true]; _target setVariable [QGVAR(nozzle), _nozzle, true]; diff --git a/addons/refuel/functions/fnc_reset.sqf b/addons/refuel/functions/fnc_reset.sqf index f0955b609a..da983e6492 100644 --- a/addons/refuel/functions/fnc_reset.sqf +++ b/addons/refuel/functions/fnc_reset.sqf @@ -20,7 +20,7 @@ params [["_target", objNull, [objNull]]]; if (local _target) then { _target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]; } else { - [QGVAR(setVehicleHitPointDamage), _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent); + ["setHitPointDamage", _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent); }; _target setVariable [QGVAR(engineHit), nil, true]; _target setVariable [QGVAR(isConnected), false, true]; diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index f3f00429da..179785f863 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -49,7 +49,7 @@ if (isNull _nozzle || {_source != _target}) exitWith {false}; deleteVehicle _nozzle; if !(local _target) then { - [QGVAR(setVehicleHitPointDamage), _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent); + ["setHitPointDamage", _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent); } else { _target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]; }; diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index 02eefe27fe..08f9e152c0 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -28,7 +28,7 @@ private _endPosOffset = [0, 0, 0]; if (isNull _nozzle) then { // func is called on fuel truck _target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true]; if !(local _target) then { - [QGVAR(setVehicleHitPointDamage), _target, ["HitEngine", 1]] call EFUNC(common,targetEvent); + ["setHitPointDamage", _target, ["HitEngine", 1]] call EFUNC(common,targetEvent); } else { _target setHitPointDamage ["HitEngine", 1]; };