Corpse looting: jump-loot on ACE (keyboard jump, before the move, every pickup)

Jump-loot called Host.JumpNonAutonomous (0xF7C9), which ACE has no handler for;
only Jump (0xF61B) is handled there, so the setting did nothing. It now uses the
keyboard jump (TapJump, 0xF61B) that the use check already uses.

The jump goes before the move, since ACE's jump handler stops any walk-to in
progress. It runs on every pickup, a corpse's only match included: most corpses
hold a single match, so the "more than one item left" gate meant jump-loot almost
never ran. A pipelined move (queued behind the last pickup's Return) still gets no
jump. Guards: the setting, the TapJump and MoveItem hooks, stamina > 5.

The tap jump has a fixed height, so the Jump Height slider is gone from the
RynthAi settings page; LootJumpHeight itself stays plumbed (settings JSON, range
table) so old profiles and metas still load.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-10-30 20:01:23 -07:00
commit 1e135c12b8
3 changed files with 22 additions and 17 deletions

View file

@ -1685,17 +1685,17 @@ public sealed partial class RynthAiPlugin
Host.SelectItem(unchecked((uint)firstMatchId));
LootDiag($"[RynthAi] {LootTag}: picking up 0x{(uint)firstMatchId:X8} '{matchItemName}' from corpse 0x{(uint)corpseId:X8}.");
// Jump-loot: jump before the move to cancel the pickup animation.
// Only jump when multiple items remain (single-item: no animation worth cancelling).
// Guards: needs both hooks, stamina > 5 to cover the cost.
int remainingItems = visibleItemCount - _processedCorpseItems.Count;
bool useJumpLoot = settings.LootJumpEnabled
&& Host.HasJumpNonAutonomous
&& Host.HasMoveItemExternal
&& _vitals.CurrentStamina > 5;
if (useJumpLoot && remainingItems > 1 && !pipelined)
Host.JumpNonAutonomous(Math.Clamp(settings.LootJumpHeight / 100f, 0.01f, 1f));
// Jump-loot: jump, then the move while the character is still in the air, so the server
// skips the pickup bend-down. The jump is the keyboard one (TapJump, 0xF61B Jump, which
// ACE handles); JumpNonAutonomous (0xF7C9) has no handler on ACE and did nothing. The
// jump goes FIRST: ACE's jump handler stops any walk-to in progress, so a jump after the
// move would cancel the pickup. Every pickup, a corpse's only match included (most
// corpses hold one match, so a multi-item gate meant jump-loot almost never ran), with
// stamina > 5 to cover the cost. Not for a pipelined move: it is already queued behind
// the last pickup's Return, and a jump there would only disturb that queue. The tap jump
// has a fixed height, so LootJumpHeight no longer has an effect.
if (!pipelined && ShouldJumpLoot(settings))
Host.TapJump();
// Always a move into a pack, never a use: a use on a wearable corpse item is
// get-and-wield, which put salvage jewellery on the character (2026-10-02).
@ -2105,6 +2105,14 @@ public sealed partial class RynthAiPlugin
/// <summary>A gap between two held calls longer than this was not one continuous hold (the corpse clock is not paid back for it).</summary>
internal const long PickupHoldMaxGapMs = 500;
/// <summary>Jump-loot for this pickup: the setting, the keyboard jump and the move call, stamina for
/// the jump.</summary>
private bool ShouldJumpLoot(LegacyUiSettings settings) =>
settings.LootJumpEnabled
&& Host.HasTapJump
&& Host.HasMoveItemExternal
&& _vitals.CurrentStamina > 5;
/// <summary>
/// True while the server owes an answer to a cast or use (ActionPacer): ACE refuses a pickup
/// then (Player.HandleActionPutItemInContainer_Verify: IsBusy -> YoureTooBusy and

View file

@ -1050,11 +1050,8 @@ internal sealed class LegacyAdvancedSettingsUi
if (ImGui.IsItemHovered())
ImGui.SetTooltip("Loots scrolls of spells you don't know and can learn (magic school trained or\nspecialized, skill high enough), and reads them when it's safe. Scrolls already\nin your pack are read too.");
ImGui.Checkbox("Jump When Looting", ref _settings.LootJumpEnabled);
if (_settings.LootJumpEnabled)
{
ImGui.SetNextItemWidth(120);
ImGui.SliderInt("Jump Height", ref _settings.LootJumpHeight, 1, 100);
}
if (ImGui.IsItemHovered())
ImGui.SetTooltip("Hop (the keyboard jump) just before each pickup,\nso the server skips the bend-down. The hop has a fixed height.");
ImGui.Spacing();
ImGui.Text("Corpse Ownership");

View file

@ -136,7 +136,7 @@ public sealed class LegacyUiSettings
public int LootOpenRetryMs = LootBaseline.OpenRetryMs;
public int LootCorpseTimeoutMs = LootBaseline.CorpseTimeoutMs;
public bool LootJumpEnabled = false;
public int LootJumpHeight = 10; // 0–100; maps to 0.0–1.0 JumpNonAutonomous extent
public int LootJumpHeight = 10; // kept for old profiles and metas; jump-loot uses the keyboard tap jump (fixed height)
public int SalvageOpenDelayFirstMs = 400;
public int SalvageOpenDelayFastMs = 50;