fix(inventory): complete switches on wield response
Clear retail AutoWield on the matching authoritative WieldObject instead of waiting for unrelated rollback bookkeeping to drain. This prevents a completed switch from consuming the next weapon activation locally, including crossbows. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
ea5cf5b842
commit
3e84027885
9 changed files with 47 additions and 21 deletions
|
|
@ -128,6 +128,8 @@ public sealed class GameEventWiringTests
|
|||
items.AddOrUpdate(new ClientObject { ObjectId = 0x1500, WeenieClassId = 1 });
|
||||
items.MoveItem(0x1500, 0x9999u, newSlot: 0); // start in a pack
|
||||
items.WieldItemOptimistic(0x1500, player, EquipMask.MeleeWeapon); // optimistic wield → snapshot pending
|
||||
var wieldConfirmed = new List<uint>();
|
||||
items.WieldConfirmed += item => wieldConfirmed.Add(item.ObjectId);
|
||||
|
||||
byte[] payload = new byte[8];
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload, 0x1500);
|
||||
|
|
@ -137,6 +139,7 @@ public sealed class GameEventWiringTests
|
|||
|
||||
Assert.False(items.RollbackMove(0x1500)); // pending snapshot was cleared by ConfirmMove
|
||||
Assert.Equal(player, items.Get(0x1500)!.ContainerId);
|
||||
Assert.Equal(new[] { 0x1500u }, wieldConfirmed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue