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

@@ -5,7 +5,6 @@ using Content.Server.GameTicking.Events;
using Content.Server.GameTicking.Presets;
using Content.Server.GameTicking.Rules;
using Content.Server.Ghost.Components;
using Content.Server.Mind;
using Content.Shared.CCVar;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
@@ -21,7 +20,6 @@ namespace Content.Server.GameTicking
public const float PresetFailedCooldownIncrease = 30f;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
public GamePresetPrototype? Preset { get; private set; }
@@ -180,7 +178,7 @@ namespace Content.Server.GameTicking
if (mind.VisitingEntity != default)
{
_mindSystem.UnVisit(mind);
mind.UnVisit();
}
var position = playerEntity is {Valid: true}
@@ -198,7 +196,7 @@ namespace Content.Server.GameTicking
// + If we're in a mob that is critical, and we're supposed to be able to return if possible,
// we're succumbing - the mob is killed. Therefore, character is dead. Ghosting OK.
// (If the mob survives, that's a bug. Ghosting is kept regardless.)
var canReturn = canReturnGlobal && _mindSystem.IsCharacterDeadPhysically(mind);
var canReturn = canReturnGlobal && mind.CharacterDeadPhysically;
if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState))
{
@@ -240,9 +238,9 @@ namespace Content.Server.GameTicking
_ghosts.SetCanReturnToBody(ghostComponent, canReturn);
if (canReturn)
_mindSystem.Visit(mind, ghost);
mind.Visit(ghost);
else
_mindSystem.TransferTo(mind, ghost);
mind.TransferTo(ghost);
return true;
}