diff --git a/gym_wrapper/base_gym_env.py b/gym_wrapper/base_gym_env.py index 79df9ff4b..bf3c32f71 100644 --- a/gym_wrapper/base_gym_env.py +++ b/gym_wrapper/base_gym_env.py @@ -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 diff --git a/gymnasium_wrapper/base_gymnasium_env.py b/gymnasium_wrapper/base_gymnasium_env.py index 3bdd82876..d0d2031fc 100644 --- a/gymnasium_wrapper/base_gymnasium_env.py +++ b/gymnasium_wrapper/base_gymnasium_env.py @@ -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