From e72241ccda91e1917243f72acc75b40d430c92f1 Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Sun, 30 Jun 2024 02:45:01 +0100 Subject: [PATCH 1/3] Improve curator editable objects --- addons/debug_console/functions/fnc_addCurator.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/debug_console/functions/fnc_addCurator.sqf b/addons/debug_console/functions/fnc_addCurator.sqf index 496cd681..1cfa9050 100644 --- a/addons/debug_console/functions/fnc_addCurator.sqf +++ b/addons/debug_console/functions/fnc_addCurator.sqf @@ -35,9 +35,12 @@ for "_i" from 0 to (count _configFile - 1) do { _allAddons pushBack _cfgName; }; +private _entities = entities [[], [], true, true]; // Players, AI and Vehicles. + _curatorModule addCuratorAddons _allAddons; _curatorModule setVariable ["showNotification", false]; -_curatorModule addCuratorEditableObjects [allUnits, true]; // all Players and AI. +_curatorModule setVariable ["BIS_fnc_initModules_activate", true, true]; +_curatorModule addCuratorEditableObjects [_entities, true]; { _curatorModule setCuratorCoef [_x, 0]; From c6b41d683884c8a4c5f2113c5611b0350cc4e473 Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Sun, 30 Jun 2024 02:45:14 +0100 Subject: [PATCH 2/3] Handle broken assignment on respawn --- addons/debug_console/XEH_PREP.hpp | 1 + addons/debug_console/XEH_postInit.sqf | 1 + .../functions/fnc_handleRespawn.sqf | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 addons/debug_console/functions/fnc_handleRespawn.sqf diff --git a/addons/debug_console/XEH_PREP.hpp b/addons/debug_console/XEH_PREP.hpp index cea4c9a6..81383079 100644 --- a/addons/debug_console/XEH_PREP.hpp +++ b/addons/debug_console/XEH_PREP.hpp @@ -1,4 +1,5 @@ PREP(addButton); PREP(addCurator); PREP(handleDisconnect); +PREP(handleRespawn); PREP(initDebugConsole); diff --git a/addons/debug_console/XEH_postInit.sqf b/addons/debug_console/XEH_postInit.sqf index 63d93998..c870bb90 100644 --- a/addons/debug_console/XEH_postInit.sqf +++ b/addons/debug_console/XEH_postInit.sqf @@ -2,6 +2,7 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", FUNC(handleDisconnect)]; + addMissionEventHandler ["EntityRespawned", FUNC(handleRespawn)]; [QGVAR(createCurator), FUNC(addCurator)] call CBA_fnc_addEventHandler; [QGVAR(stopRain), { params ["_caller"]; diff --git a/addons/debug_console/functions/fnc_handleRespawn.sqf b/addons/debug_console/functions/fnc_handleRespawn.sqf new file mode 100644 index 00000000..d5300092 --- /dev/null +++ b/addons/debug_console/functions/fnc_handleRespawn.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: Mike + * Handles respawn of players. + * + * Arguments: + * 0: New Unit + * 1: Old Unit (Unused) + * + * Return Value: + * None + * + * Public: No +*/ + +params ["_newUnit", "_oldUnit"]; + +if (GVAR(playerCurators) isEqualTo []) exitWith {}; + +private _playerUID = getPlayerUID _newUnit; +private _moduleData = GVAR(playerCurators) select {_playerUID in _x}; + +if (_moduleData isEqualTo []) exitWith {}; + +// Break old curator assignment +private _module = (_moduleData select 0) select 0; +unassignCurator _module; + +// Reassign curator back to original player +_module assignCurator _newUnit; From 1106ee7d2a92d187ea3f4c4f635ba5de213b845a Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Mon, 1 Jul 2024 16:41:47 +0100 Subject: [PATCH 3/3] Update fnc_addCurator.sqf --- addons/debug_console/functions/fnc_addCurator.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/debug_console/functions/fnc_addCurator.sqf b/addons/debug_console/functions/fnc_addCurator.sqf index 1cfa9050..ecc94d14 100644 --- a/addons/debug_console/functions/fnc_addCurator.sqf +++ b/addons/debug_console/functions/fnc_addCurator.sqf @@ -39,7 +39,7 @@ private _entities = entities [[], [], true, true]; // Players, AI and Vehicles. _curatorModule addCuratorAddons _allAddons; _curatorModule setVariable ["showNotification", false]; -_curatorModule setVariable ["BIS_fnc_initModules_activate", true, true]; +_curatorModule setVariable ["BIS_fnc_initModules_activate", true, true]; // Manually activate module, 1.86 didnt activate modules when created via script, unsure if still true. _curatorModule addCuratorEditableObjects [_entities, true]; {