Fix interaction test mind fuckery (#15726)

This commit is contained in:
Leon Friedrich
2023-04-24 18:50:37 +12:00
committed by GitHub
parent 29787f3944
commit a6baf77204

View File

@@ -5,6 +5,7 @@ using Content.Client.Construction;
using Content.Client.Examine; using Content.Client.Examine;
using Content.Server.Body.Systems; using Content.Server.Body.Systems;
using Content.Server.Mind.Components; using Content.Server.Mind.Components;
using Content.Server.Players;
using Content.Server.Stack; using Content.Server.Stack;
using Content.Server.Tools; using Content.Server.Tools;
using Content.Shared.Body.Part; using Content.Shared.Body.Part;
@@ -107,7 +108,6 @@ public abstract partial class InteractionTest
protected ConstructionSystem CConSys = default!; protected ConstructionSystem CConSys = default!;
protected ExamineSystem ExamineSys = default!; protected ExamineSystem ExamineSys = default!;
protected InteractionTestSystem CTestSystem = default!; protected InteractionTestSystem CTestSystem = default!;
protected UserInterfaceSystem CUISystem = default!;
// player components // player components
protected HandsComponent Hands = default!; protected HandsComponent Hands = default!;
@@ -164,6 +164,10 @@ public abstract partial class InteractionTest
EntityUid? old = default; EntityUid? old = default;
await Server.WaitPost(() => await Server.WaitPost(() =>
{ {
// Fuck you mind system I want an hour of my life back
// Mind system is a time vampire
ServerSession.ContentData()?.WipeMind();
old = cPlayerMan.LocalPlayer.ControlledEntity; old = cPlayerMan.LocalPlayer.ControlledEntity;
Player = SEntMan.SpawnEntity(PlayerPrototype, PlayerCoords); Player = SEntMan.SpawnEntity(PlayerPrototype, PlayerCoords);
ServerSession.AttachToEntity(Player); ServerSession.AttachToEntity(Player);
@@ -178,17 +182,11 @@ public abstract partial class InteractionTest
// Delete old player entity. // Delete old player entity.
await Server.WaitPost(() => await Server.WaitPost(() =>
{ {
if (old == null) if (old != null)
return; SEntMan.DeleteEntity(old.Value);
// Fuck you mind system I want an hour of my life back
if (SEntMan.TryGetComponent(old, out MindComponent? mind))
mind.GhostOnShutdown = false;
SEntMan.DeleteEntity(old.Value);
}); });
// Ensure that the player only has one hand, so that they do not accidentally pick up deconstruction protucts // Ensure that the player only has one hand, so that they do not accidentally pick up deconstruction products
await Server.WaitPost(() => await Server.WaitPost(() =>
{ {
var bodySystem = SEntMan.System<BodySystem>(); var bodySystem = SEntMan.System<BodySystem>();