Mind ecs (#14412)
This commit is contained in:
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -20,6 +21,7 @@ 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; }
|
||||
|
||||
@@ -178,7 +180,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
if (mind.VisitingEntity != default)
|
||||
{
|
||||
mind.UnVisit();
|
||||
_mindSystem.UnVisit(mind);
|
||||
}
|
||||
|
||||
var position = playerEntity is {Valid: true}
|
||||
@@ -196,7 +198,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 && mind.CharacterDeadPhysically;
|
||||
var canReturn = canReturnGlobal && _mindSystem.IsCharacterDeadPhysically(mind);
|
||||
|
||||
if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState))
|
||||
{
|
||||
@@ -238,9 +240,9 @@ namespace Content.Server.GameTicking
|
||||
_ghosts.SetCanReturnToBody(ghostComponent, canReturn);
|
||||
|
||||
if (canReturn)
|
||||
mind.Visit(ghost);
|
||||
_mindSystem.Visit(mind, ghost);
|
||||
else
|
||||
mind.TransferTo(ghost);
|
||||
_mindSystem.TransferTo(mind, ghost);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user