Skip to content

Enhance capture cancellation handling and logging in CaptureListener#6

Merged
Adammatthiesen merged 1 commit into
mainfrom
fix-capture-action
Jul 1, 2026
Merged

Enhance capture cancellation handling and logging in CaptureListener#6
Adammatthiesen merged 1 commit into
mainfrom
fix-capture-action

Conversation

@Adammatthiesen

Copy link
Copy Markdown
Member

This pull request improves the handling and logging of canceled Pokémon capture events during battles in the CaptureListener class. The main changes add detailed logging, ensure proper cleanup when a capture is canceled mid-battle, and send the correct network packet to notify the client.

Key improvements to capture cancellation during battles:

  • Added detailed info logs for each step of the capture cancellation process, including reasons for cancellation and error handling.
  • When a capture is canceled during a battle, the code now:
    • Checks for a valid battle instance and capture action, logging and returning early if not found.
    • Sends a BattleCaptureEndPacket to notify the client that the capture has ended. [1] [2]
    • Calls finishCaptureAction to properly clean up the capture action in the battle.

These changes make the capture cancellation process more robust and transparent, especially in the context of ongoing battles.

@Adammatthiesen Adammatthiesen marked this pull request as ready for review July 1, 2026 03:09
@Adammatthiesen Adammatthiesen merged commit 6638271 into main Jul 1, 2026
1 check failed
@Adammatthiesen Adammatthiesen deleted the fix-capture-action branch July 1, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant