Skip to content

Commit

Permalink
fixed Necto (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDowns authored Jun 20, 2022
1 parent 3ada424 commit 951cc1a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions RLBotPack/Necto/Necto/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ def get_output(self, packet: GameTickPacket) -> SimpleControllerState:
self.ticks += ticks_elapsed
self.game_state.decode(packet, ticks_elapsed)

if not packet.game_info.is_round_active:
self.obs_builder.reset(self.game_state)
if self.update_action == 1 and len(self.game_state.players) > self.index:
self.update_action = 0

if self.update_action and len(self.game_state.players) > self.index:
player = self.game_state.players[self.index]
teammates = [p for p in self.game_state.players if p.team_num == self.team and p != player]
opponents = [p for p in self.game_state.players if p.team_num != self.team]
Expand All @@ -114,13 +113,10 @@ def get_output(self, packet: GameTickPacket) -> SimpleControllerState:
if self.render:
self.render_attention_weights(weights, obs)

# if self.ticks >= self.tick_skip - 1:
# self.update_controls(self.action)

if self.ticks >= self.tick_skip:
self.ticks = 0
self.update_controls(self.action)
self.update_action = True
self.update_action = 1

if self.hardcoded_kickoffs:
self.maybe_do_kickoff(packet, ticks_elapsed)
Expand Down

0 comments on commit 951cc1a

Please sign in to comment.