Skip to content

Commit

Permalink
Maybe? (#1845)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsnider committed Aug 10, 2023
1 parent 7fbb126 commit 6aa838e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Intersect.Server/Core/LogicService.LogicThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
7 changes: 6 additions & 1 deletion Intersect.Server/Maps/MapInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6aa838e

Please sign in to comment.