From 8560297816bd66cdf0e7cdc9831e2ed9a963d4aa Mon Sep 17 00:00:00 2001 From: TenuredCLOUD <85143513+TenuredCLOUD@users.noreply.github.com> Date: Sat, 27 Jun 2026 13:42:50 -0700 Subject: [PATCH] Remove RemoteExec's - title, moved remoteExec to proper CBA events --- addons/compat_wzc/XEH_postInit.sqf | 5 ++++ .../functions/fnc_convertToZombie.sqf | 2 +- addons/lantern/XEH_postInit.sqf | 26 ++++++++++++++++--- addons/lantern/functions/fnc_keybind.sqf | 4 +-- addons/lantern/functions/fnc_logicCheck.sqf | 2 +- addons/radio/functions/fnc_queueTrack.sqf | 2 +- addons/repair/XEH_postInit.sqf | 5 ++++ addons/repair/functions/fnc_process.sqf | 2 +- 8 files changed, 38 insertions(+), 10 deletions(-) diff --git a/addons/compat_wzc/XEH_postInit.sqf b/addons/compat_wzc/XEH_postInit.sqf index c9f7975f..b9904c8d 100644 --- a/addons/compat_wzc/XEH_postInit.sqf +++ b/addons/compat_wzc/XEH_postInit.sqf @@ -2,6 +2,11 @@ if (!GVAR(enabled)) exitWith {}; +[QGVAR(convertToZed), { + params ["_unit", "_animParams"]; + _unit switchMove (_animParams select 0); +}] call CBA_fnc_addEventHandler; + if (hasInterface) then { if (GVAR(infectionEnabled)) then { call FUNC(infect); diff --git a/addons/compat_wzc/functions/fnc_convertToZombie.sqf b/addons/compat_wzc/functions/fnc_convertToZombie.sqf index a48beec0..3af2fe82 100644 --- a/addons/compat_wzc/functions/fnc_convertToZombie.sqf +++ b/addons/compat_wzc/functions/fnc_convertToZombie.sqf @@ -17,7 +17,7 @@ call EFUNC(common,getPlayerVariables) params ["", "", "", "", "", "", "", "_infection"]; if (!(player getVariable ["WBK_AI_ISZombie", false]) && _infection >= 1) then { - [player, ["WBK_Runner_Angry_Idle", 0, 0.2, false]] remoteExec ["switchMove", 0]; + [QGVAR(convertToZed), [player, ["WBK_Runner_Angry_Idle", 0, 0.2, false]]] call CBA_fnc_globalEvent; player setVariable ["WBK_SynthHP", WBK_Zombies_CorruptedHP, true]; player setVariable ["WBK_AI_ISZombie", true, true]; player setVariable ["WBK_AI_ZombieMoveSet", "WBK_Runner_Angry_Idle", true]; diff --git a/addons/lantern/XEH_postInit.sqf b/addons/lantern/XEH_postInit.sqf index e2d4a599..2cbd0009 100644 --- a/addons/lantern/XEH_postInit.sqf +++ b/addons/lantern/XEH_postInit.sqf @@ -1,5 +1,23 @@ #include "script_component.hpp" +[QGVAR(deleteLantern), { + params ["_lantern"]; + if (alive _lantern) then { + deleteVehicle _lantern; + }; +}] call CBA_fnc_addEventHandler; + +[QGVAR(attachLantern), { + params ["_lantern", "_attachParams"]; + _lantern attachTo _attachParams; + + // Since power component removes light from lanterns re-add it after its attached + [{ + params ["_lantern"]; + _lantern switchLight "ON"; + }, [_lantern], 0.02] call CBA_fnc_waitAndExecute; +}] call CBA_fnc_addEventHandler; + if (isServer) then { private _lanternBatteries = [ @@ -21,7 +39,7 @@ if (isServer) then { if (_killed isEqualTo player && {local _killed}) then { if (!isNil {_killed getVariable [QGVAR(state), nil]}) then { private _lantern = _killed getVariable [QGVAR(state), nil]; - [_lantern] remoteExec ["deleteVehicle", [0, -2] select isDedicated, _lantern]; + [QGVAR(deleteLantern), [_lantern]] call CBA_fnc_globalEvent; _killed setVariable [QGVAR(state), nil, true]; }; }; @@ -34,7 +52,7 @@ if (hasInterface) then { if (_item isEqualTo QCLASS(lantern_On) && {local _unit}) then { if (!isNil {_unit getVariable [QGVAR(state), nil]}) then { private _lantern = _unit getVariable [QGVAR(state), nil]; - [_lantern] remoteExec ["deleteVehicle", [0, -2] select isDedicated, _lantern]; + [QGVAR(deleteLantern), [_lantern]] call CBA_fnc_globalEvent; _unit setVariable [QGVAR(state), nil, true]; }; }; @@ -46,7 +64,7 @@ if (hasInterface) then { if (isNil {_unit getVariable [QGVAR(state), nil]}) then { private _lantern = "Land_Camping_Light_F" createVehicle position _unit; _lantern setVariable [QGRADGVAR(persistence,isExcluded), true, true]; - [_lantern, [_unit, [-0.17, -0.14, -0.06], "Pelvis", true]] remoteExec ["attachTo", [0, -2] select isDedicated, _lantern]; + [QGVAR(attachLantern), [_lantern, [_unit, [-0.17, -0.14, -0.06], "Pelvis", true]]] call CBA_fnc_globalEvent; _unit setVariable [QGVAR(state), _lantern, true]; }; }; @@ -58,7 +76,7 @@ if (hasInterface) then { if (!isNil {player getVariable [QGVAR(state), nil]}) then { private _lantern = player getVariable [QGVAR(state), nil]; - [_lantern] remoteExec ["deleteVehicle", [0, -2] select isDedicated, _lantern]; + [QGVAR(deleteLantern), [_lantern]] call CBA_fnc_globalEvent; [player, [QCLASS(lantern_On), QCLASS(lantern_Off)], false] call EFUNC(common,switchPowerState); diff --git a/addons/lantern/functions/fnc_keybind.sqf b/addons/lantern/functions/fnc_keybind.sqf index 337254b7..69679bed 100644 --- a/addons/lantern/functions/fnc_keybind.sqf +++ b/addons/lantern/functions/fnc_keybind.sqf @@ -28,7 +28,7 @@ if ([[QCLASS(lantern_Off)]] call EFUNC(common,hasItem)) then { _lantern setVariable [QGRADGVAR(persistence,isExcluded), true, true]; - [_lantern, [player, [-0.17, -0.14, -0.06], "Pelvis", true]] remoteExec ["attachTo", [0, -2] select isDedicated, _lantern]; + [QGVAR(attachLantern), [_lantern, [player, [-0.17, -0.14, -0.06], "Pelvis", true]]] call CBA_fnc_globalEvent; player setVariable [QGVAR(state), _lantern, true]; }; @@ -38,7 +38,7 @@ if ([[QCLASS(lantern_On)]] call EFUNC(common,hasItem)) then { if (!isNil {player getVariable [QGVAR(state), nil]}) then { private _lantern = player getVariable [QGVAR(state), nil]; - [_lantern] remoteExec ["deleteVehicle", [0, -2] select isDedicated, _lantern]; + [QGVAR(deleteLantern), [_lantern]] call CBA_fnc_globalEvent; [player, [QCLASS(lantern_On), QCLASS(lantern_Off)], false] call EFUNC(common,switchPowerState); diff --git a/addons/lantern/functions/fnc_logicCheck.sqf b/addons/lantern/functions/fnc_logicCheck.sqf index 4ff4ab80..8eb2d05f 100644 --- a/addons/lantern/functions/fnc_logicCheck.sqf +++ b/addons/lantern/functions/fnc_logicCheck.sqf @@ -19,7 +19,7 @@ if !([[QCLASS(lantern_On)]] call EFUNC(common,hasItem)) exitWith { if (!isNil {player getVariable [QGVAR(state), nil]}) then { private _lantern = player getVariable [QGVAR(state), nil]; - [_lantern] remoteExec ["deleteVehicle", [0, -2] select isDedicated, _lantern]; + [QGVAR(deleteLantern), [_lantern]] call CBA_fnc_globalEvent; player setVariable [QGVAR(state), nil, true]; }; }; diff --git a/addons/radio/functions/fnc_queueTrack.sqf b/addons/radio/functions/fnc_queueTrack.sqf index 8d996a79..3947afbd 100644 --- a/addons/radio/functions/fnc_queueTrack.sqf +++ b/addons/radio/functions/fnc_queueTrack.sqf @@ -34,7 +34,7 @@ publicVariable QGVAR(allRadioSounds); private _soundSource = createVehicle ["Land_HelipadEmpty_F", getPosASL _x, [], 0, "CAN_COLLIDE"]; _soundSource attachTo [_x, [0, 0, 0]]; GVAR(allRadioSounds) pushBack _soundSource; - [_soundSource, [_trkName, 150]] remoteExec ["say3D", 0, _soundSource]; + [QEGVAR(audio,say3D), [_soundSource, _trkName, 150]] call CBA_fnc_globalEvent; } forEach GVAR(allRadios); publicVariable QGVAR(allRadioSounds); diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index f6aa63fa..b6d86a37 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -3,3 +3,8 @@ ["CBA_settingsInitialized", { call FUNC(action); }] call CBA_fnc_addEventHandler; + +[QGVAR(repairVehiclePart), { + params ["_vehicle", "_repairParams"]; + _vehicle setHitPointDamage _repairParams; +}] call CBA_fnc_addEventHandler; diff --git a/addons/repair/functions/fnc_process.sqf b/addons/repair/functions/fnc_process.sqf index 02b95677..e85263be 100644 --- a/addons/repair/functions/fnc_process.sqf +++ b/addons/repair/functions/fnc_process.sqf @@ -104,7 +104,7 @@ private _fundsPerTick = _repairPrice / _totalSteps; private _partDamage = _damages select _targetIndex; private _newDamage = (_partDamage - _repairStep) max 0; - [_nearestVehicle, [_partName, _newDamage]] remoteExecCall ["setHitPointDamage", _nearestVehicle]; + [QGVAR(repairVehiclePart), [_nearestVehicle, [_partName, _newDamage]]] call CBA_fnc_globalEvent; [-_fundsPerTick] call EFUNC(currency,modifyMoney);