fix(items): finish corpse pickup and combat switching
Port retail's first-slot ShowPendingInPlayer path for double-click loot and carry the current owned-container destination through deferred pickup. Retire the previous ground-container view as soon as a replacement is requested so its range close cannot cancel ACE's active MoveTo chain. Preserve active-combat weapon intent across ACE's authoritative wand-to-missile stance tail while leaving peace-mode switches unchanged. Release build succeeds and all 5,885 tests pass with five intentional skips. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
d51a0fc825
commit
0392c6d721
17 changed files with 631 additions and 81 deletions
|
|
@ -111,7 +111,7 @@ public sealed class ExternalContainerControllerTests
|
|||
sendWield: null,
|
||||
sendDrop: null,
|
||||
groundObjectId: () => State.CurrentContainerId,
|
||||
placeInBackpack: Pickups.Add,
|
||||
placeInBackpack: (item, _, _) => Pickups.Add(item),
|
||||
sendPutItemInContainer: (item, container, placement) =>
|
||||
Puts.Add((item, container, placement)),
|
||||
sendSplitToContainer: (item, container, placement, amount) =>
|
||||
|
|
@ -213,6 +213,35 @@ public sealed class ExternalContainerControllerTests
|
|||
Assert.True(h.Window.IsVisible);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReplacementRequest_HidesOldViewWithoutSendingRangeCloseUse()
|
||||
{
|
||||
using var h = new Harness();
|
||||
const uint replacement = 0x70000002u;
|
||||
h.Open(Chest);
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = replacement,
|
||||
Type = ItemType.Container,
|
||||
ItemsCapacity = 24,
|
||||
Useability = ItemUseability.Remote,
|
||||
});
|
||||
|
||||
h.State.RequestOpen(replacement);
|
||||
h.InRange = false;
|
||||
h.Controller.Tick();
|
||||
|
||||
Assert.Equal(0u, h.State.CurrentContainerId);
|
||||
Assert.Equal(replacement, h.State.RequestedContainerId);
|
||||
Assert.False(h.Window.IsVisible);
|
||||
Assert.Empty(h.Uses);
|
||||
Assert.Equal(new uint[] { Chest }, h.NoLonger);
|
||||
|
||||
h.State.ApplyViewContents(replacement);
|
||||
Assert.Equal(replacement, h.State.CurrentContainerId);
|
||||
Assert.True(h.Window.IsVisible);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DropOwnedPartialStackIntoChest_UsesSplitRequestWithoutLocalMove()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -663,6 +663,49 @@ public class InventoryControllerTests
|
|||
Assert.Equal(Player, objects.Get(loot)!.ContainerId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DoubleClickLoot_ReservesFirstOpenPackSlotBeforePickupIsSent()
|
||||
{
|
||||
const uint chest = 0x70000011u;
|
||||
const uint loot = 0x70000012u;
|
||||
var (layout, grid, _, _, _, _, _, _) = BuildLayout();
|
||||
var objects = new ClientObjectTable();
|
||||
SeedContained(objects, 0xAu, Player, slot: 0);
|
||||
SeedContained(objects, 0xBu, Player, slot: 1);
|
||||
SeedContained(objects, loot, chest, slot: 0, type: ItemType.Misc);
|
||||
var pickups = new List<(uint item, uint container, int placement)>();
|
||||
using var interaction = new ItemInteractionController(
|
||||
objects,
|
||||
playerGuid: () => Player,
|
||||
sendUse: null,
|
||||
sendUseWithTarget: null,
|
||||
sendWield: null,
|
||||
sendDrop: null,
|
||||
nowMs: () => 1_000,
|
||||
groundObjectId: () => chest,
|
||||
backpackContainerId: () => Player,
|
||||
placeInBackpack: (item, container, placement) =>
|
||||
pickups.Add((item, container, placement)));
|
||||
using var inventory = InventoryController.Bind(
|
||||
layout,
|
||||
objects,
|
||||
() => Player,
|
||||
iconIds: static (_, _, _, _, _) => 0u,
|
||||
strength: () => 100,
|
||||
selection: new SelectionState(),
|
||||
datFont: null,
|
||||
itemInteraction: interaction);
|
||||
|
||||
Assert.True(interaction.ActivateItem(loot));
|
||||
|
||||
Assert.Equal(new[] { (loot, Player, 0) }, pickups);
|
||||
Assert.Equal(chest, objects.Get(loot)!.ContainerId);
|
||||
Assert.Equal(loot, grid.GetItem(0)!.ItemId);
|
||||
Assert.True(grid.GetItem(0)!.WaitingVisual);
|
||||
Assert.Equal(0xAu, grid.GetItem(1)!.ItemId);
|
||||
Assert.Equal(0xBu, grid.GetItem(2)!.ItemId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LootDrop_ServerFailureRemovesOnlyThePendingProjection()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue