fix(items): preserve wand stance and corpse use order
Keep active-combat AutoWield intent through ACE's pre-wield transition and queued trailing peace notice, while allowing explicit combat input to supersede it. Queue one-shot item interactions until the frame's movement edge has been serialized, so a movement release cannot cancel ACE's server-side corpse approach callback. Release build succeeds and all 5,890 runnable tests pass with five intentional skips. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
0392c6d721
commit
e6dd8bf6fa
10 changed files with 303 additions and 22 deletions
|
|
@ -0,0 +1,56 @@
|
|||
using AcDream.App.Input;
|
||||
|
||||
namespace AcDream.App.Tests.Input;
|
||||
|
||||
public sealed class OutboundInteractionQueueTests
|
||||
{
|
||||
[Fact]
|
||||
public void Drain_PreservesInputOrder()
|
||||
{
|
||||
var queue = new OutboundInteractionQueue();
|
||||
var actual = new List<string>();
|
||||
|
||||
queue.Enqueue(() => actual.Add("use-corpse"));
|
||||
queue.Enqueue(() => actual.Add("pickup-item"));
|
||||
|
||||
queue.Drain();
|
||||
|
||||
Assert.Equal(new[] { "use-corpse", "pickup-item" }, actual);
|
||||
Assert.Equal(0, queue.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Drain_ReentrantEnqueueWaitsForNextFrame()
|
||||
{
|
||||
var queue = new OutboundInteractionQueue();
|
||||
var actual = new List<string>();
|
||||
queue.Enqueue(() =>
|
||||
{
|
||||
actual.Add("first");
|
||||
queue.Enqueue(() => actual.Add("next-frame"));
|
||||
});
|
||||
|
||||
queue.Drain();
|
||||
|
||||
Assert.Equal(new[] { "first" }, actual);
|
||||
Assert.Equal(1, queue.Count);
|
||||
|
||||
queue.Drain();
|
||||
|
||||
Assert.Equal(new[] { "first", "next-frame" }, actual);
|
||||
Assert.Equal(0, queue.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Clear_DropsPendingSessionActions()
|
||||
{
|
||||
var queue = new OutboundInteractionQueue();
|
||||
bool invoked = false;
|
||||
queue.Enqueue(() => invoked = true);
|
||||
|
||||
queue.Clear();
|
||||
queue.Drain();
|
||||
|
||||
Assert.False(invoked);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue