Remove IMobStateComponent (#5220)

This commit is contained in:
Javier Guardia Fernández
2021-11-08 15:11:58 +01:00
committed by GitHub
parent 4236551d86
commit f5b11d6af8
35 changed files with 84 additions and 144 deletions

View File

@@ -1,12 +1,11 @@
using System;
using Content.Server.CharacterAppearance.Components;
using Content.Server.EUI;
using Content.Server.Mind.Components;
using Content.Server.Power.Components;
using Content.Server.UserInterface;
using Content.Shared.CharacterAppearance.Systems;
using Content.Shared.Cloning;
using Content.Shared.MobState;
using Content.Shared.MobState.Components;
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -108,7 +107,7 @@ namespace Content.Server.Cloning.Components
if (cloningSystem.ClonesWaitingForMind.TryGetValue(mind, out var cloneUid))
{
if (Owner.EntityManager.TryGetEntity(cloneUid, out var clone) &&
clone.TryGetComponent<IMobStateComponent>(out var cloneState) &&
clone.TryGetComponent<MobStateComponent>(out var cloneState) &&
!cloneState.IsDead() &&
clone.TryGetComponent(out MindComponent? cloneMindComp) &&
(cloneMindComp.Mind == null || cloneMindComp.Mind == mind))
@@ -121,7 +120,7 @@ namespace Content.Server.Cloning.Components
}
if (mind.OwnedEntity != null &&
mind.OwnedEntity.TryGetComponent<IMobStateComponent>(out var state) &&
mind.OwnedEntity.TryGetComponent<MobStateComponent>(out var state) &&
!state.IsDead())
{
obj.Session.AttachedEntity?.PopupMessageCursor(Loc.GetString("cloning-pod-component-msg-already-alive"));