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

@@ -11,6 +11,7 @@ using Content.Shared.MobState.Components;
using Content.Shared.Verbs;
using Robust.Shared.Player;
using System.Threading;
using Content.Server.MobState;
namespace Content.Server.Medical
{
@@ -18,6 +19,7 @@ namespace Content.Server.Medical
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
public override void Initialize()
{
@@ -135,7 +137,7 @@ namespace Content.Server.Medical
public void ExamineWithStethoscope(EntityUid user, EntityUid target)
{
/// The mob check seems a bit redundant but (1) they could conceivably have lost it since when the doafter started and (2) I need it for .IsDead()
if (!HasComp<RespiratorComponent>(target) || !TryComp<MobStateComponent>(target, out var mobState) || mobState.IsDead())
if (!HasComp<RespiratorComponent>(target) || !TryComp<MobStateComponent>(target, out var mobState) || _mobStateSystem.IsDead(target, mobState))
{
_popupSystem.PopupEntity(Loc.GetString("stethoscope-dead"), target, user);
return;