Cleaned up obsolete properties from MobStateComponent (#13097)
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Server.Access.Systems;
|
||||
using Content.Server.DeviceNetwork;
|
||||
using Content.Server.DeviceNetwork.Components;
|
||||
using Content.Server.DeviceNetwork.Systems;
|
||||
using Content.Server.MobState;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Examine;
|
||||
@@ -22,6 +23,7 @@ namespace Content.Server.Medical.SuitSensors
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IdCardSystem _idCardSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly DeviceNetworkSystem _deviceNetworkSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
@@ -244,7 +246,7 @@ namespace Content.Server.Medical.SuitSensors
|
||||
var isAlive = false;
|
||||
if (EntityManager.TryGetComponent(sensor.User.Value, out MobStateComponent? mobState))
|
||||
{
|
||||
isAlive = mobState.IsAlive();
|
||||
isAlive = _mobStateSystem.IsAlive(sensor.User.Value, mobState);
|
||||
}
|
||||
|
||||
// get mob total damage
|
||||
|
||||
Reference in New Issue
Block a user