Vitals: a kit its result line calls used up is not picked again #27
Loading…
Reference in a new issue
No description provided.
Delete branch "AwfulWaffle/RynthSuite:kit-used-up"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Independent: applies to main alone.
What went wrong in play
A kit's last heal ends with "... Your Treated Healing Kit is used up." (ACE
Healer.DoHealing), and the server removes the kit. A used-up kit that was still listed got picked again and again. ACE answers a use of an item the player no longer has with a bare UseDone and no chat, so no heal landed. The character died with the next kit still in the pack.Main's live-walk lookup removes most of this: kit picks read the client's own pack walk (
WorldObjectCache.GetDirectInventory). Two gaps are left:DirectInventoryCooldownMs), and the next kit goes out 700 ms after the result line (KitLandGraceMs). Inside that window the used-up kit can still be picked from the last walk. A probe on pristine main showed it: the pick 750 ms after the line was the used-up kit.GetContainerContents. There is no walk at all. The inventory view is the object cache, which can keep the removed kit for good. RynthAi feature-detects that call, so this is a supported configuration.The fix
Combat/BuffManager.KitUsedUp.cs(new):ConsumableLookup.Resolve);BestPackHealingKitandBestPackStaminaKit;UsedUpKitSkipMs), long enough for a fresh walk to have dropped the kit. Without the walk it lasts for the session: the server deleted the object, and its id never comes back.ConsumableLookup.Resolvetakes an optional skip predicate. A skipped listed id falls through to the name match, so the next stack of that name is used.WorldObjectCache.WalkClockis the clock thatGetDirectInventory's reuse runs on. It isRynthClockunless a test sets it. The tests freeze it, so the walk never refreshes and only the skip can keep the used-up kit out.This is the only part of the earlier kit-drop work that the live walk has not made redundant. Not carried:
How it was tested
Run from
Tools\RynthCore.RynthAiHostTests:The one failure is
map bake: 0x6346 ..., the same one pristine main has (1494/1495).New tests:
KitUsedUpTests(6), with the walk's clock frozen:GetContainerContents, the next pick at +3.2 s is still the next kit and never the used-up one;Checked against deliberately broken code:
KitUsedUpstubbed to false, 4 of 6 fail;Scope and risk
WalkClockis a test seam. With nothing setting it, the walk behaves exactly as before.🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.