Fix thread pool IoC context bug in DecalSystem. (#12993)
Fixes https://github.com/space-wizards/space-station-14/issues/12992
This commit is contained in:
committed by
GitHub
parent
1923ab3015
commit
32908fee67
@@ -23,6 +23,7 @@ namespace Content.Server.Decals
|
|||||||
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
|
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
|
||||||
[Dependency] private readonly IParallelManager _parMan = default!;
|
[Dependency] private readonly IParallelManager _parMan = default!;
|
||||||
[Dependency] private readonly ChunkingSystem _chunking = default!;
|
[Dependency] private readonly ChunkingSystem _chunking = default!;
|
||||||
|
[Dependency] private readonly IDependencyCollection _dependencies = default!;
|
||||||
|
|
||||||
private readonly Dictionary<EntityUid, HashSet<Vector2i>> _dirtyChunks = new();
|
private readonly Dictionary<EntityUid, HashSet<Vector2i>> _dirtyChunks = new();
|
||||||
private readonly Dictionary<IPlayerSession, Dictionary<EntityUid, HashSet<Vector2i>>> _previousSentChunks = new();
|
private readonly Dictionary<IPlayerSession, Dictionary<EntityUid, HashSet<Vector2i>>> _previousSentChunks = new();
|
||||||
@@ -407,6 +408,8 @@ namespace Content.Server.Decals
|
|||||||
|
|
||||||
public void UpdatePlayer(IPlayerSession player)
|
public void UpdatePlayer(IPlayerSession player)
|
||||||
{
|
{
|
||||||
|
IoCManager.InitThread(_dependencies, replaceExisting: true);
|
||||||
|
|
||||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||||
var chunksInRange = _chunking.GetChunksForSession(player, ChunkSize, xformQuery, _chunkIndexPool, _chunkViewerPool);
|
var chunksInRange = _chunking.GetChunksForSession(player, ChunkSize, xformQuery, _chunkIndexPool, _chunkViewerPool);
|
||||||
var staleChunks = _chunkViewerPool.Get();
|
var staleChunks = _chunkViewerPool.Get();
|
||||||
|
|||||||
Reference in New Issue
Block a user