From a1b0c35303a16b56f4b8c05535350f8cb318f508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolaj=20=C3=98sterby=20Jensen?= Date: Sat, 25 Jan 2025 15:37:56 +0100 Subject: [PATCH] Fix hiveminds and scripts not blocking correctly --- rlbot/managers/hivemind.py | 5 +---- rlbot/managers/script.py | 5 +---- rlbot/version.py | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/rlbot/managers/hivemind.py b/rlbot/managers/hivemind.py index 1983255..0cfbbd7 100644 --- a/rlbot/managers/hivemind.py +++ b/rlbot/managers/hivemind.py @@ -170,7 +170,6 @@ def _packet_processor(self, packet: flat.GamePacket): def _run(self): running = True - has_more_messages = True while running: # If there might be more messages, @@ -178,13 +177,11 @@ def _run(self): # if there are no more messages, process the latest packet # then wait for the next message with blocking=True match self._game_interface.handle_incoming_messages( - blocking=not has_more_messages + blocking=self._latest_packet is None ): case MsgHandlingResult.TERMINATED: running = False case MsgHandlingResult.NO_INCOMING_MSGS: - has_more_messages = False - if self._latest_packet is not None: self._packet_processor(self._latest_packet) self._latest_packet = None diff --git a/rlbot/managers/script.py b/rlbot/managers/script.py index dd96f8b..b1d8578 100644 --- a/rlbot/managers/script.py +++ b/rlbot/managers/script.py @@ -127,7 +127,6 @@ def _packet_processor(self, packet: flat.GamePacket): def _run(self): running = True - has_more_messages = True while running: # If there might be more messages, @@ -135,13 +134,11 @@ def _run(self): # if there are no more messages, process the latest packet # then wait for the next message with blocking=True match self._game_interface.handle_incoming_messages( - blocking=not has_more_messages + blocking=self._latest_packet is None ): case MsgHandlingResult.TERMINATED: running = False case MsgHandlingResult.NO_INCOMING_MSGS: - has_more_messages = False - if self._latest_packet is not None: self._packet_processor(self._latest_packet) self._latest_packet = None diff --git a/rlbot/version.py b/rlbot/version.py index cbabffa..844de4d 100644 --- a/rlbot/version.py +++ b/rlbot/version.py @@ -1 +1 @@ -__version__ = "2.0.0-beta.20" +__version__ = "2.0.0-beta.21"