From 55f52f76be910fd8f7ab0c5136a78e0026f1b5f2 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 15 Jan 2022 20:06:48 +1300 Subject: [PATCH] Fix more component-dependency purge issues (#6178) --- Content.Server/Doors/Components/AirlockComponent.cs | 2 +- .../Morgue/Components/CrematoriumEntityStorageComponent.cs | 2 +- Content.Server/Power/Components/ApcComponent.cs | 2 +- Content.Server/Power/Components/ExaminableBatteryComponent.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Content.Server/Doors/Components/AirlockComponent.cs b/Content.Server/Doors/Components/AirlockComponent.cs index de969c590b..4a38a2d761 100644 --- a/Content.Server/Doors/Components/AirlockComponent.cs +++ b/Content.Server/Doors/Components/AirlockComponent.cs @@ -131,7 +131,7 @@ namespace Content.Server.Doors.Components public bool IsPowered() { - return _entityManager.TryGetComponent(Owner, out var receiverComponent) && receiverComponent.Powered; + return !_entityManager.TryGetComponent(Owner, out var receiverComponent) || receiverComponent.Powered; } public void UpdateBoltLightStatus() diff --git a/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs b/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs index 713ce90e47..cb78bf0ccb 100644 --- a/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs +++ b/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs @@ -50,7 +50,7 @@ namespace Content.Server.Morgue.Components void IExamine.Examine(FormattedMessage message, bool inDetailsRange) { - if (_entities.TryGetComponent(Owner, out var appearance)) return; + if (!_entities.TryGetComponent(Owner, out var appearance)) return; if (inDetailsRange) { diff --git a/Content.Server/Power/Components/ApcComponent.cs b/Content.Server/Power/Components/ApcComponent.cs index 582e6f9a5a..97752804bb 100644 --- a/Content.Server/Power/Components/ApcComponent.cs +++ b/Content.Server/Power/Components/ApcComponent.cs @@ -90,7 +90,7 @@ namespace Content.Server.Power.Components return; var accessSystem = EntitySystem.Get(); - if (_entMan.TryGetComponent(Owner, out var accessReaderComponent) || accessSystem.IsAllowed(accessReaderComponent, attached)) + if (!_entMan.TryGetComponent(Owner, out var accessReaderComponent) || accessSystem.IsAllowed(accessReaderComponent, attached)) { MainBreakerEnabled = !MainBreakerEnabled; _entMan.GetComponent(Owner).CanDischarge = MainBreakerEnabled; diff --git a/Content.Server/Power/Components/ExaminableBatteryComponent.cs b/Content.Server/Power/Components/ExaminableBatteryComponent.cs index ec8a44ebce..5df79ff0b8 100644 --- a/Content.Server/Power/Components/ExaminableBatteryComponent.cs +++ b/Content.Server/Power/Components/ExaminableBatteryComponent.cs @@ -18,7 +18,7 @@ namespace Content.Server.Power.Components void IExamine.Examine(FormattedMessage message, bool inDetailsRange) { - if (_entityManager.TryGetComponent(Owner, out var batteryComponent)) + if (!_entityManager.TryGetComponent(Owner, out var batteryComponent)) return; if (inDetailsRange) {