Add interaction tests for mousetraps (#35502)

* Add interaction tests for mousetraps

* Silly yaml linter

* review

* fix debugging thing

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Tayrtahn
2025-10-03 14:45:50 -04:00
committed by GitHub
parent 63c8dc572b
commit d8e005087c
4 changed files with 172 additions and 6 deletions

View File

@@ -169,6 +169,12 @@ public abstract partial class InteractionTest
/// <param name="enableToggleable">Whether or not to automatically enable any toggleable items</param>
protected async Task<NetEntity> PlaceInHands(EntitySpecifier entity, bool enableToggleable = true)
{
if (Hands == null)
{
Assert.Fail("No HandsComponent");
return default;
}
if (Hands.ActiveHandId == null)
{
Assert.Fail("No active hand");
@@ -210,6 +216,12 @@ public abstract partial class InteractionTest
{
entity ??= Target;
if (Hands == null)
{
Assert.Fail("No HandsComponent");
return;
}
if (Hands.ActiveHandId == null)
{
Assert.Fail("No active hand");
@@ -860,7 +872,7 @@ public abstract partial class InteractionTest
/// List of currently active DoAfters on the player.
/// </summary>
protected IEnumerable<Shared.DoAfter.DoAfter> ActiveDoAfters
=> DoAfters.DoAfters.Values.Where(x => !x.Cancelled && !x.Completed);
=> DoAfters?.DoAfters.Values.Where(x => !x.Cancelled && !x.Completed) ?? [];
#region Component