From 9f129938c9c75bb4513b0b93248985100fe0e921 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 16 Jul 2013 17:43:36 -0700 Subject: Attachments module only registers when enabled. This enables alternative attachments module implementations. All calls to Scene.AttachmentsModule are checking for null. Ideally, if we support disabling attachments then we need a null attachments module to register with the scene. --- OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index f69ec21..2f5a76f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -74,10 +74,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments public void AddRegion(Scene scene) { m_scene = scene; - m_scene.RegisterModuleInterface(this); - if (Enabled) { + // Only register module with scene if it is enabled. All callers check for a null attachments module. + // Ideally, there should be a null attachments module for when this core attachments module has been + // disabled. Registering only when enabled allows for other attachments module implementations. + m_scene.RegisterModuleInterface(this); m_scene.EventManager.OnNewClient += SubscribeToClientEvents; m_scene.EventManager.OnStartScript += (localID, itemID) => HandleScriptStateChange(localID, true); m_scene.EventManager.OnStopScript += (localID, itemID) => HandleScriptStateChange(localID, false); -- cgit v1.1