fix(inventory): await final wield confirmation
Keep the retail inventory transaction busy until authoritative WieldObject confirms the requested weapon. This prevents rapid weapon changes from overlapping on ACE and rejecting otherwise valid items such as spears. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
815ce0dec4
commit
ea5cf5b842
8 changed files with 115 additions and 9 deletions
|
|
@ -743,6 +743,25 @@ public sealed class ClientObjectTableTests
|
|||
seen);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ConfirmMove_publishesOnlyAfterFinalOutstandingRequest()
|
||||
{
|
||||
var table = new ClientObjectTable();
|
||||
const uint item = 0x944u, player = 0x50000001u, pack = 0x40000005u;
|
||||
table.AddOrUpdate(new ClientObject { ObjectId = item });
|
||||
table.MoveItem(item, pack, 2);
|
||||
table.WieldItemOptimistic(item, player, EquipMask.MeleeWeapon);
|
||||
table.MoveItemOptimistic(item, pack, 0);
|
||||
var confirmed = new List<uint>();
|
||||
table.MoveRequestConfirmed += moved => confirmed.Add(moved.ObjectId);
|
||||
|
||||
table.ConfirmMove(item);
|
||||
Assert.Empty(confirmed);
|
||||
|
||||
table.ConfirmMove(item);
|
||||
Assert.Equal(new[] { item }, confirmed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WieldThenMove_oneConfirm_rollsBackToPreWield() // outstanding-count across wield+move (shared RecordPending)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue