diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index c162f8802d..a89e3fb8e3 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,5 +1,22 @@ #include "script_component.hpp" +//Delete map glow lights from disconnecting players #2810 +if (isServer) then { + addMissionEventHandler ["HandleDisconnect",{ + params ["_disconnectedPlayer"]; + + if ((!GVAR(mapGlow)) || {isNull _disconnectedPlayer}) exitWith {}; + { + if (_x isKindOf "ACE_FlashlightProxy_White") then { + // ACE_LOGINFO_2("Deleting leftover light [%1:%2] from DC player [%3]", _x, typeOf _x, _disconnectedPlayer); + deleteVehicle _x; + }; + } forEach attachedObjects _disconnectedPlayer; + + nil + }]; +}; + // Exit on Headless as well if (!hasInterface) exitWith {};