Cleaned up obsolete properties from MobStateComponent (#13097)

Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
Jezithyr
2022-12-19 19:25:35 -08:00
committed by GitHub
parent 7259acfb18
commit 5f9b4adf47
22 changed files with 91 additions and 78 deletions

View File

@@ -1,4 +1,5 @@
using Content.Server.Interaction.Components;
using Content.Server.MobState;
using Content.Server.Popups;
using Content.Shared.Bed.Sleep;
using Content.Shared.IdentityManagement;
@@ -15,6 +16,7 @@ public sealed class InteractionPopupSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
public override void Initialize()
@@ -38,7 +40,7 @@ public sealed class InteractionPopupSystem : EntitySystem
return;
if (TryComp<MobStateComponent>(uid, out var state) // if it has a MobStateComponent,
&& !state.IsAlive()) // AND if that state is not Alive (e.g. dead/incapacitated/critical)
&& !_mobStateSystem.IsAlive(uid, state)) // AND if that state is not Alive (e.g. dead/incapacitated/critical)
return;
// TODO: Should be an attempt event