fix wrongfully kicking players when releasing a critter#3290
Conversation
Greptile SummaryThis PR fixes a regression in
Confidence Score: 4/5The change is a focused one-line fix that aligns OnReleaseNPC with every other handler in Bouncer.cs, and the new code path has no side-effects beyond the existing kick/allow logic. The core fix is correct and the SelectedItem pattern is already used consistently throughout the file. The only change worth a second look is the incidental removal of the Explosive Bunny comment, which reduces clarity without affecting behaviour. No files require special attention beyond the removed comment inside OnReleaseNPC. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Server
participant Bouncer
Client->>Server: PlayerUpdate (selectedItem index synced)
Client->>Server: ReleaseNPC packet (type, style)
Server->>Bouncer: OnReleaseNPC(args)
Bouncer->>Bouncer: Read args.Player.SelectedItem
alt "SelectedItem.makeNPC == type AND placeStyle == style"
Bouncer->>Server: Allow critter release
else "type == ExplosiveBunny AND ownedProjectileCounts > 0"
Bouncer->>Server: Allow (delayed projectile release)
else Mismatch
Bouncer->>Client: Kick released critter was not from its item
end
|
Fix critter release kicking issue
since
lastVisualizedSelectedItemis not synced between server and client, it stays as default Item value. this causesmakeNPCto always be0, failing the check and making Bouncer interpret every critter release as an invalid action, resulting in a player kick