Fix gumball buff leaking to the wrong nano on slot change#321
Open
kamilprzyb2 wants to merge 1 commit into
Open
Fix gumball buff leaking to the wrong nano on slot change#321kamilprzyb2 wants to merge 1 commit into
kamilprzyb2 wants to merge 1 commit into
Conversation
The gumball (stimpak) buff is keyed to the nano slot (ECSB_STIMPAKSLOT1 + slot), not to the nano that consumed the gumball. Nothing cleared that buff when the slot's occupant changed, so swapping or replacing an equipped nano left the buff on the slot and the incoming nano inherited the boost. This bypassed the gumball/nano-style check in useGumball() and mislabeled the wrong nano as buffed on the client HUD. A slot swap carries no source slot and no dedicated opcode, so the client expresses it as NANO_EQUIP packets that overwrite slots in place; drop the slot's stimpak buff in nanoEquipHandler whenever the occupant changes, and in nanoUnEquipHandler when the nano leaves the slot. removeBuff() clears the effect and resends the corrected condition bitflag, fixing both the boost and the HUD icon. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix gumball buff leaking to the wrong nano on slot change
Problem
The gumball (stimpak) buff is keyed to the nano slot (
ECSB_STIMPAKSLOT1 + slot), not to the nano that consumed the gumball. Nothing cleared that buff when the slot's occupant changed, so swapping equipped nanos (or replacing one in place) left the buff on the slot and the incoming nano inherited the boost.This bypasses the gumball/nano-style match check in
useGumball()(a gumball can be applied to a nano whose style it doesn't match) and shows the buff icon on the wrong nano in the client HUD.Fix
Drop the slot's stimpak buff whenever its occupant changes:
nanoEquipHandler— when a different nano is equipped into the slot. A slot swap carries no source-slot field and no dedicated opcode, so the client expresses it as in-placeNANO_EQUIPoverwrites; this is the path that catches the reported exploit.nanoUnEquipHandler— when the nano leaves the slot.removeBuff()clears the effect and resends the corrected condition bitflag, so both the gameplay boost and the HUD icon are fixed.Testing (protocol 104)
Reproduced on an unpatched build and confirmed fixed on the patched build, covering:
Normal gumball use on the matching nano is unaffected.
🤖 Generated with Claude Code