From 32908fee67c849c09c1628b083d8fb96b8604b34 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 12 Dec 2022 23:45:29 +0100 Subject: [PATCH] Fix thread pool IoC context bug in DecalSystem. (#12993) Fixes https://github.com/space-wizards/space-station-14/issues/12992 --- Content.Server/Decals/DecalSystem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Server/Decals/DecalSystem.cs b/Content.Server/Decals/DecalSystem.cs index b152d3e026..2bc91bad06 100644 --- a/Content.Server/Decals/DecalSystem.cs +++ b/Content.Server/Decals/DecalSystem.cs @@ -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> _dirtyChunks = new(); private readonly Dictionary>> _previousSentChunks = new(); @@ -407,6 +408,8 @@ namespace Content.Server.Decals public void UpdatePlayer(IPlayerSession player) { + IoCManager.InitThread(_dependencies, replaceExisting: true); + var xformQuery = GetEntityQuery(); var chunksInRange = _chunking.GetChunksForSession(player, ChunkSize, xformQuery, _chunkIndexPool, _chunkViewerPool); var staleChunks = _chunkViewerPool.Get();