Fix more component-dependency purge issues (#6178)

This commit is contained in:
Leon Friedrich
2022-01-15 20:06:48 +13:00
committed by GitHub
parent 7f39f5ff4b
commit 55f52f76be
4 changed files with 4 additions and 4 deletions

View File

@@ -131,7 +131,7 @@ namespace Content.Server.Doors.Components
public bool IsPowered() public bool IsPowered()
{ {
return _entityManager.TryGetComponent<ApcPowerReceiverComponent>(Owner, out var receiverComponent) && receiverComponent.Powered; return !_entityManager.TryGetComponent<ApcPowerReceiverComponent>(Owner, out var receiverComponent) || receiverComponent.Powered;
} }
public void UpdateBoltLightStatus() public void UpdateBoltLightStatus()

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Morgue.Components
void IExamine.Examine(FormattedMessage message, bool inDetailsRange) void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
{ {
if (_entities.TryGetComponent<AppearanceComponent>(Owner, out var appearance)) return; if (!_entities.TryGetComponent<AppearanceComponent>(Owner, out var appearance)) return;
if (inDetailsRange) if (inDetailsRange)
{ {

View File

@@ -90,7 +90,7 @@ namespace Content.Server.Power.Components
return; return;
var accessSystem = EntitySystem.Get<AccessReaderSystem>(); var accessSystem = EntitySystem.Get<AccessReaderSystem>();
if (_entMan.TryGetComponent<AccessReaderComponent>(Owner, out var accessReaderComponent) || accessSystem.IsAllowed(accessReaderComponent, attached)) if (!_entMan.TryGetComponent<AccessReaderComponent>(Owner, out var accessReaderComponent) || accessSystem.IsAllowed(accessReaderComponent, attached))
{ {
MainBreakerEnabled = !MainBreakerEnabled; MainBreakerEnabled = !MainBreakerEnabled;
_entMan.GetComponent<PowerNetworkBatteryComponent>(Owner).CanDischarge = MainBreakerEnabled; _entMan.GetComponent<PowerNetworkBatteryComponent>(Owner).CanDischarge = MainBreakerEnabled;

View File

@@ -18,7 +18,7 @@ namespace Content.Server.Power.Components
void IExamine.Examine(FormattedMessage message, bool inDetailsRange) void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
{ {
if (_entityManager.TryGetComponent<BatteryComponent>(Owner, out var batteryComponent)) if (!_entityManager.TryGetComponent<BatteryComponent>(Owner, out var batteryComponent))
return; return;
if (inDetailsRange) if (inDetailsRange)
{ {