Inline OwnerUid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 16:30:34 +01:00
parent 2eacf98335
commit f386b57148
85 changed files with 219 additions and 215 deletions

View File

@@ -94,7 +94,7 @@ namespace Content.Server.Storage.Components
private void UpdateStorageVisualization()
{
if (!_entityManager.TryGetComponent(OwnerUid, out AppearanceComponent appearance))
if (!_entityManager.TryGetComponent(((IComponent) this).Owner, out AppearanceComponent appearance))
return;
bool open = SubscribedSessions.Count != 0;
@@ -102,7 +102,7 @@ namespace Content.Server.Storage.Components
appearance.SetData(StorageVisuals.Open, open);
appearance.SetData(SharedBagOpenVisuals.BagState, open ? SharedBagState.Open : SharedBagState.Closed);
if (_entityManager.HasComponent<ItemCounterComponent>(OwnerUid))
if (_entityManager.HasComponent<ItemCounterComponent>(((IComponent) this).Owner))
appearance.SetData(StackVisuals.Hide, !open);
}
@@ -402,7 +402,7 @@ namespace Content.Server.Storage.Components
{
if (_entityManager.TryGetComponent(entity, out ServerStorageComponent storageComponent))
{
DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {OwnerUid}");
DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {((IComponent) this).Owner}");
storageComponent.UnsubscribeSession(session);
}