From 42179578fc5292d9bd12aeccc45948d908c42d1a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 5 Jun 2012 01:33:58 +0100 Subject: Allow fix-phantoms command to appear even if CombineContiguousRegions = false, since this allows one to go back from a megaregion to normal regions. Adapted from a patch by Garmin Kawaguichi in http://opensimulator.org/mantis/view.php?id=6027 Garmin says that fix-phantoms allows one to reset objects when going back from megaregion to normal regions as well as the othe rway around. Thanks! --- .../RegionCombinerModule/RegionCombinerModule.cs | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/RegionCombinerModule') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 40daf13..3555028 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.RegionCombinerModule /// /// Is this module enabled? /// - private bool enabledYN = false; + private bool m_combineContiguousRegions = false; /// /// This holds the root regions for the megaregions. @@ -79,14 +79,12 @@ namespace OpenSim.Region.RegionCombinerModule public void Initialise(IConfigSource source) { IConfig myConfig = source.Configs["Startup"]; - enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); + m_combineContiguousRegions = myConfig.GetBoolean("CombineContiguousRegions", false); - if (enabledYN) - { - MainConsole.Instance.Commands.AddCommand( - "RegionCombinerModule", false, "fix-phantoms", "fix-phantoms", - "Fixes phantom objects after an import to megaregions", FixPhantoms); - } + MainConsole.Instance.Commands.AddCommand( + "RegionCombinerModule", false, "fix-phantoms", "fix-phantoms", + "Fixes phantom objects after an import to a megaregion or a change from a megaregion back to normal regions", + FixPhantoms); } public void Close() @@ -95,7 +93,7 @@ namespace OpenSim.Region.RegionCombinerModule public void AddRegion(Scene scene) { - if (enabledYN) + if (m_combineContiguousRegions) scene.RegisterModuleInterface(this); } @@ -105,7 +103,10 @@ namespace OpenSim.Region.RegionCombinerModule public void RegionLoaded(Scene scene) { - if (enabledYN) + lock (m_startingScenes) + m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); + + if (m_combineContiguousRegions) { RegionLoadedDoWork(scene); @@ -208,7 +209,6 @@ namespace OpenSim.Region.RegionCombinerModule { return; } - } } @@ -220,8 +220,6 @@ namespace OpenSim.Region.RegionCombinerModule return; // */ - lock (m_startingScenes) - m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); // Give each region a standard set of non-infinite borders Border northBorder = new Border(); -- cgit v1.1