diff --git a/Intersect.Server/Core/LogicService.LogicThread.cs b/Intersect.Server/Core/LogicService.LogicThread.cs index 8dc9e35e08..82ff65aa89 100644 --- a/Intersect.Server/Core/LogicService.LogicThread.cs +++ b/Intersect.Server/Core/LogicService.LogicThread.cs @@ -167,7 +167,7 @@ protected override void ThreadStart(ServerContext serverContext) { ActiveMapInstances[layerId].RemoveLayerFromController(); ActiveMapInstances.Remove(layerId); - } else if (ActiveMapInstances[layerId] == null) + } else if (ActiveMapInstances[layerId] == null || !ActiveMapInstances[layerId].ShouldBeActive()) { ActiveMapInstances.Remove(layerId); } diff --git a/Intersect.Server/Maps/MapInstance.cs b/Intersect.Server/Maps/MapInstance.cs index 54c88a4e86..cf6621a4af 100644 --- a/Intersect.Server/Maps/MapInstance.cs +++ b/Intersect.Server/Maps/MapInstance.cs @@ -171,7 +171,12 @@ public void Initialize() public bool ShouldBeCleaned() { - return (MapInstanceId != OverworldInstanceId && !mIsProcessing && LastRequestedUpdateTime > mLastUpdateTime + Options.Map.TimeUntilMapCleanup); + return (MapInstanceId != OverworldInstanceId && !ShouldBeActive()); + } + + public bool ShouldBeActive() + { + return (mIsProcessing || LastRequestedUpdateTime <= mLastUpdateTime + Options.Map.TimeUntilMapCleanup); } public void RemoveLayerFromController()