Add interaction tests (#15251)

This commit is contained in:
Leon Friedrich
2023-04-15 07:41:25 +12:00
committed by GitHub
parent ffe946729f
commit 489660a6bb
36 changed files with 2354 additions and 32 deletions

View File

@@ -27,7 +27,20 @@ public sealed class DoAfterComponentState : ComponentState
public DoAfterComponentState(DoAfterComponent component)
{
NextId = component.NextId;
// Cursed test bugs - See CraftingTests.CancelCraft
// The following is wrapped in an if DEBUG. This is tests don't (de)serialize net messages and just copy objects
// by reference. This means that the server will directly modify cached server states on the client's end.
// Crude fix at the moment is to used modified state handling while in debug mode Otherwise, this test cannot work.
#if !DEBUG
DoAfters = component.DoAfters;
#else
DoAfters = new();
foreach (var (id, doafter) in component.DoAfters)
{
DoAfters.Add(id, new DoAfter(doafter));
}
#endif
}
}

View File

@@ -123,7 +123,6 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
EnsureComp<ActiveDoAfterComponent>(uid);
}
#region Creation
/// <summary>
/// Tasks that are delayed until the specified time has passed