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:
Pieter-Jan Briers
2022-12-12 23:45:29 +01:00
committed by GitHub
parent 1923ab3015
commit 32908fee67

View File

@@ -23,6 +23,7 @@ namespace Content.Server.Decals
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
[Dependency] private readonly IParallelManager _parMan = default!;
[Dependency] private readonly ChunkingSystem _chunking = default!;
[Dependency] private readonly IDependencyCollection _dependencies = default!;
private readonly Dictionary<EntityUid, HashSet<Vector2i>> _dirtyChunks = new();
private readonly Dictionary<IPlayerSession, Dictionary<EntityUid, HashSet<Vector2i>>> _previousSentChunks = new();
@@ -407,6 +408,8 @@ namespace Content.Server.Decals
public void UpdatePlayer(IPlayerSession player)
{
IoCManager.InitThread(_dependencies, replaceExisting: true);
var xformQuery = GetEntityQuery<TransformComponent>();
var chunksInRange = _chunking.GetChunksForSession(player, ChunkSize, xformQuery, _chunkIndexPool, _chunkViewerPool);
var staleChunks = _chunkViewerPool.Get();