Revert "Mind ecs" (#14881)

This commit is contained in:
Leon Friedrich
2023-03-27 10:24:00 +13:00
committed by GitHub
parent c6c8fa2075
commit 4d71b1b81e
85 changed files with 684 additions and 1150 deletions

View File

@@ -1,6 +1,5 @@
using System.Linq;
using Content.Server.Chemistry.Components.SolutionManager;
using Content.Server.Mind;
using Content.Server.Mind.Components;
using Content.Server.Power.Components;
using Content.Shared.Tag;
@@ -22,7 +21,7 @@ namespace Content.Server.Bql
{
return input.Where(e =>
{
if (entityManager.TryGetComponent<MindContainerComponent>(e, out var mind))
if (entityManager.TryGetComponent<MindComponent>(e, out var mind))
return (mind.Mind?.VisitingEntity == e) ^ isInverted;
return isInverted;
@@ -33,7 +32,7 @@ namespace Content.Server.Bql
{
return DoSelection(
entityManager.EntityQuery<MindContainerComponent>().Select(x => x.Owner),
entityManager.EntityQuery<MindComponent>().Select(x => x.Owner),
arguments, isInverted, entityManager);
}
}
@@ -69,16 +68,14 @@ namespace Content.Server.Bql
public override IEnumerable<EntityUid> DoSelection(IEnumerable<EntityUid> input, IReadOnlyList<object> arguments, bool isInverted, IEntityManager entityManager)
{
var mindSystem = entityManager.System<MindSystem>();
return input.Where(e =>
entityManager.TryGetComponent<MindContainerComponent>(e, out var mind)
&& mind.Mind != null
&& !mindSystem.IsCharacterDeadPhysically(mind.Mind));
(entityManager.TryGetComponent<MindComponent>(e, out var mind) &&
!(mind.Mind?.CharacterDeadPhysically ?? false)) ^ isInverted);
}
public override IEnumerable<EntityUid> DoInitialSelection(IReadOnlyList<object> arguments, bool isInverted, IEntityManager entityManager)
{
return DoSelection(entityManager.EntityQuery<MindContainerComponent>().Select(x => x.Owner), arguments,
return DoSelection(entityManager.EntityQuery<MindComponent>().Select(x => x.Owner), arguments,
isInverted, entityManager);
}
}