RynthAi: no false "never reached your hand" weapon ban #21
Loading…
Reference in a new issue
No description provided.
Delete branch "AwfulWaffle/RynthSuite:wield-ban-false-positive"
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?
Depends on: nothing (RynthSuite, based on upstream/main
7166d25). Two commits on one branch; the second is separable (see Scope and risk).What went wrong in play
A weapon that did reach the hand was banned for 30 minutes as "it never reached your hand (the client refused the wield)". Buffing swapped the weapon out for a wand before combat looked again, so combat saw it missing, counted each wield as a failed try, and gave up on it. A readable equipment list was enough to trigger the ban.
The fix
Commit 1, "no false never-reached ban" (the sighting fix):
WeaponSwapTrackerremembers weapons seen in a main-hand slot while their wields are under way (SeenWielded,WasSeenWielded,HasAttemptsAt). A sighting resets that weapon's try count; a fresh run of wields forgets the old sighting.CombatManager.NoteSwapWieldsSeen()samples the engine's equipment list (read only, no game command, fault-tolerant). It runs fromOnHeartbeatand every tick fromRynthAiPlugin, ahead of the buffing hold, which skips combat's heartbeat. Only main-hand slots count; a weapon in the shield slot is not the wield combat asked for.NeverReachedHand(id)replaces the old "equipment list readable" test: the weapon must be absent now AND never seen wielded during the run.Commit 2, "a relog ends never-reached bans" (separable):
_neverReachedBans).SetPlayerId(login or relog) lifts them and logs how many; the server's own "skill too low" bans stay, and a real one outranks a never-reached ban on the same weapon.NoteSkillTooLowgains aneverReachedflag for this.How it was tested
Build (from the worktree root), at each commit:
Result: Build succeeded, 0 Error(s).
Host tests (from
Tools\RynthCore.RynthAiHostTests):The one failure is
map bake: 0x6346 from the real dats ..., which needs the game dats and also fails on pristine upstream/main (baseline 1494/1495). The full suite was run on the final state only. NewWieldBanTestsare registered with one line inProgram.cs(the relog test's registration arrives with commit 2).Scope and risk
Commit 1:
Combat/CombatManager.cs,Combat/WeaponSwapTracker.cs,RynthAiPlugin.cs(one call),Tests/WieldBanTests.cs,Program.cs(one line). Commit 2:Combat/CombatManager.csandTests/WieldBanTests.csonly; it can be dropped on its own and commit 1 still builds and passes. Only the never-reached ban path changes. Risk: a weapon that truly never reaches the hand is still banned, but only after a run with no sighting in a main-hand slot; the extra equipment-list read happens only while wields are in flight or recently counted.🤖 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.