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,7 +1,7 @@
using System.Linq;
using Content.Server.Mind.Components;
using Content.Server.Objectives.Interfaces;
using Content.Shared.MobState;
using Content.Shared.MobState.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -20,7 +20,7 @@ namespace Content.Server.Objectives.Conditions
var allHumans = entityMgr.EntityQuery<MindComponent>(true).Where(mc =>
{
var entity = mc.Mind?.OwnedEntity;
return (entity?.GetComponentOrNull<IMobStateComponent>()?.IsAlive() ?? false) && mc.Mind != mind;
return (entity?.GetComponentOrNull<MobStateComponent>()?.IsAlive() ?? false) && mc.Mind != mind;
}).Select(mc => mc.Mind).ToList();
return new KillRandomPersonCondition {Target = IoCManager.Resolve<IRobustRandom>().Pick(allHumans)};
}