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,6 +1,7 @@
using Content.Server.Actions;
using Content.Server.Inventory;
using Content.Server.Mind.Components;
using Content.Server.MobState;
using Content.Server.Polymorph.Components;
using Content.Server.Popups;
using Content.Shared.Actions;
@@ -25,6 +26,7 @@ namespace Content.Server.Polymorph.Systems
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly ServerInventorySystem _inventory = default!;
[Dependency] private readonly SharedHandsSystem _sharedHands = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly ContainerSystem _container = default!;
public override void Initialize()
@@ -157,8 +159,8 @@ namespace Content.Server.Polymorph.Systems
if (!TryComp<MobStateComponent>(comp.Owner, out var mob))
continue;
if ((proto.RevertOnDeath && mob.IsDead()) ||
(proto.RevertOnCrit && mob.IsCritical()))
if ((proto.RevertOnDeath && _mobStateSystem.IsDead(comp.Owner, mob)) ||
(proto.RevertOnCrit && _mobStateSystem.IsCritical(comp.Owner, mob)))
Revert(comp.Owner);
}
}