Skip to content

Commit

Permalink
Handle tera issues in doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
hsahovic committed Jun 28, 2023
1 parent 7e91ee6 commit a463580
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/poke_env/player/battle_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def join_orders(first_orders, second_orders):
if not first_order.mega or not second_order.mega
if not first_order.z_move or not second_order.z_move
if not first_order.dynamax or not second_order.dynamax
if not first_order.terastallize or not second_order.terastallize
if first_order.order != second_order.order
]
if orders:
Expand Down
4 changes: 4 additions & 0 deletions src/poke_env/player/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ async def _handle_battle_message(self, split_messages: List[List[str]]) -> None:
" Pokémon."
):
await self._handle_battle_request(battle, maybe_default_order=True)
elif split_message[2].startswith(
"[Invalid choice] Can't move: You can only Terastallize once per battle."
):
await self._handle_battle_request(battle, maybe_default_order=True)
else:
self.logger.critical("Unexpected error message: %s", split_message)
elif split_message[1] == "turn":
Expand Down

0 comments on commit a463580

Please sign in to comment.