Skip to content

Commit 45c1c07

Browse files
committed
Allow bots to pass an index into set_loadout
1 parent 5e96b0f commit 45c1c07

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

rlbot/managers/bot.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,16 @@ def set_game_state(
261261
game_state = fill_desired_game_state(balls, cars, match_info, commands)
262262
self._game_interface.send_game_state(game_state)
263263

264-
def set_loadout(self, loadout: flat.PlayerLoadout):
264+
def set_loadout(self, loadout: flat.PlayerLoadout, index: Optional[int] = None):
265265
"""
266266
Sets the loadout of a bot.
267267
Can be used to select or generate a loadout for the match when called inside `initialize`.
268268
Does nothing if called outside `initialize` unless state setting is enabled in which case it
269269
respawns the car with the new loadout.
270270
"""
271-
self._game_interface.send_set_loadout(flat.SetLoadout(self.index, loadout))
271+
self._game_interface.send_set_loadout(
272+
flat.SetLoadout(index or self.index, loadout)
273+
)
272274

273275
def initialize(self):
274276
"""

rlbot/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.0-beta.34"
1+
__version__ = "2.0.0-beta.35"

0 commit comments

Comments
 (0)