Skip to content

Commit

Permalink
Fix for the bug reported in #574
Browse files Browse the repository at this point in the history
  • Loading branch information
mwydmuch committed Dec 15, 2023
1 parent 527a934 commit 928d1f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gym_wrapper/base_gym_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __parse_binary_buttons(self, env_action, agent_action):
if self.num_delta_buttons != 0:
agent_action = agent_action["binary"]

if isinstance(agent_action, int):
if np.issubdtype(type(agent_action), np.integer):
agent_action = self.button_map[agent_action]

# binary actions offset by number of delta buttons
Expand Down
2 changes: 1 addition & 1 deletion gymnasium_wrapper/base_gymnasium_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __parse_binary_buttons(self, env_action, agent_action):
if self.num_delta_buttons != 0:
agent_action = agent_action["binary"]

if isinstance(agent_action, int):
if np.issubdtype(type(agent_action), np.integer):
agent_action = self.button_map[agent_action]

# binary actions offset by number of delta buttons
Expand Down

0 comments on commit 928d1f8

Please sign in to comment.