Skip to content

Commit

Permalink
Fix TestSuicideByHeldItem and TestSuicideByHeldItemSpreadDamage
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffMe authored and dffdff2423 committed Nov 6, 2024
1 parent 9864bd6 commit b56ab5d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ await server.WaitAssertion(() =>
await pair.CleanReturnAsync();
}

/// <summary>
/// <summary>
/// Run the suicide command in the console
/// Should only ghost the player but not kill them
/// </summary>
Expand Down Expand Up @@ -241,6 +241,7 @@ public async Task TestSuicideByHeldItem()
var mindSystem = entManager.System<SharedMindSystem>();
var mobStateSystem = entManager.System<MobStateSystem>();
var transformSystem = entManager.System<TransformSystem>();
var damageableSystem = entManager.System<DamageableSystem>();

// 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;
Expand Down Expand Up @@ -276,6 +277,8 @@ await server.WaitPost(() =>
// 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();
Expand Down Expand Up @@ -313,6 +316,7 @@ public async Task TestSuicideByHeldItemSpreadDamage()
var mindSystem = entManager.System<SharedMindSystem>();
var mobStateSystem = entManager.System<MobStateSystem>();
var transformSystem = entManager.System<TransformSystem>();
var damageableSystem = entManager.System<DamageableSystem>();

// 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;
Expand Down Expand Up @@ -348,6 +352,8 @@ await server.WaitPost(() =>
// 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();
Expand Down

0 comments on commit b56ab5d

Please sign in to comment.