From 08d007771946c13fe5c0607347b07d222db00232 Mon Sep 17 00:00:00 2001 From: FluffMe <1780586+FluffMe@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:52:49 +0100 Subject: [PATCH] Fix TestSuicideByHeldItem and TestSuicideByHeldItemSpreadDamage (#33030) --- .../Tests/Commands/SuicideCommandTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs b/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs index e1eef2be4a..cf88f3aacd 100644 --- a/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs +++ b/Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs @@ -168,7 +168,7 @@ public sealed class SuicideCommandTests await pair.CleanReturnAsync(); } - /// + /// /// Run the suicide command in the console /// Should only ghost the player but not kill them /// @@ -241,6 +241,7 @@ public sealed class SuicideCommandTests var mindSystem = entManager.System(); var mobStateSystem = entManager.System(); var transformSystem = entManager.System(); + var damageableSystem = entManager.System(); // We need to know the player and whether they can be hurt, killed, and whether they have a mind var player = playerMan.Sessions.First().AttachedEntity!.Value; @@ -276,6 +277,8 @@ public sealed class SuicideCommandTests // and that all the damage is concentrated in the Slash category await server.WaitAssertion(() => { + // Heal all damage first (possible low pressure damage taken) + damageableSystem.SetAllDamage(player, damageableComp, 0); consoleHost.GetSessionShell(playerMan.Sessions.First()).ExecuteCommand("suicide"); var lethalDamageThreshold = mobThresholdsComp.Thresholds.Keys.Last(); @@ -313,6 +316,7 @@ public sealed class SuicideCommandTests var mindSystem = entManager.System(); var mobStateSystem = entManager.System(); var transformSystem = entManager.System(); + var damageableSystem = entManager.System(); // We need to know the player and whether they can be hurt, killed, and whether they have a mind var player = playerMan.Sessions.First().AttachedEntity!.Value; @@ -348,6 +352,8 @@ public sealed class SuicideCommandTests // and that slash damage is split in half await server.WaitAssertion(() => { + // Heal all damage first (possible low pressure damage taken) + damageableSystem.SetAllDamage(player, damageableComp, 0); consoleHost.GetSessionShell(playerMan.Sessions.First()).ExecuteCommand("suicide"); var lethalDamageThreshold = mobThresholdsComp.Thresholds.Keys.Last(); -- 2.52.0