Inline TryGetComponent completely, for real

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:17:01 +01:00
parent 2ff4ec65d5
commit 69b270017b
425 changed files with 1143 additions and 995 deletions

View File

@@ -267,7 +267,7 @@ namespace Content.Server.AI.Pathfinding
// TODO: Check for powered I think (also need an event for when it's depowered
// AccessReader calls this whenever opening / closing but it can seem to get called multiple times
// Which may or may not be intended?
if (entity.TryGetComponent(out AccessReader? accessReader) && !_accessReaders.ContainsKey(entity))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out AccessReader? accessReader) && !_accessReaders.ContainsKey(entity))
{
_accessReaders.Add(entity, accessReader);
ParentChunk.Dirty();