diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index cabbd317fb..16cbbf5d37 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs @@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) { - if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) + if (m_enableWindlight) { - List param = compileWindlightSettings(wl); - client.SendGenericMessage("Windlight", param); + if (m_scene.RegionInfo.WindlightSettings.valid) + { + List param = compileWindlightSettings(wl); + client.SendGenericMessage("Windlight", param); + } + else + { + List param = new List(); + client.SendGenericMessage("WindlightReset", param); + } } } @@ -175,8 +183,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare private void EventManager_OnSaveNewWindlightProfile() { - if (m_scene.RegionInfo.WindlightSettings.valid) - m_scene.ForEachRootClient(SendProfileToClient); + m_scene.ForEachRootClient(SendProfileToClient); } public void PostInitialise() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index cb0d7658aa..77a784d077 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; if (m_host.ParentGroup.Scene.SimulationDataService != null) m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); + m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); } /// /// Set the current Windlight scene to a target avatar