Skip to content

Commit

Permalink
updated player1 spelling error
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 12, 2024
1 parent 1fe63a4 commit 099cca7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions clash_royale/envs/game_engine/game_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ def legal_actions(self, player_id: int) -> npt.NDArray[np.float64]:
"""
Returns a list of legal actions.
"""
actions = np.zeros(shape=(32, 18, 5), dtype=np.float64)
actions[:,:,4] = 1 # no card is always legal
actions = np.zeros(shape=(32, 18, 4), dtype=np.float64)

hand: List[Card]
if player_id == 0:
hand = self.player_1.get_pseudo_legal_cards()
hand = self.player1.get_pseudo_legal_cards()
else:
hand = self.player_2.get_pseudo_legal_cards()
hand = self.player2.get_pseudo_legal_cards()

placement_mask = self.arena.get_placement_mask()
for card_index in hand:
Expand Down

0 comments on commit 099cca7

Please sign in to comment.