Skip to content

Commit

Permalink
retro: Fix loading valid actions (fixes #149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicki Pfau committed Mar 22, 2019
1 parent 76e4109 commit 7de79d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.7.1

* fix discrete and multi-discrete action space filtering

## 0.7.0

* move some buggy games from the `stable` integrations folder to `experimental`
Expand Down
2 changes: 1 addition & 1 deletion retro/retro_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ def __init__(self, game, state=retro.State.DEFAULT, scenario=None, info=None, us
core = retro.get_system_info(self.system)
self.buttons = core['buttons']
self.num_buttons = len(self.buttons)
self.button_combos = self.data.valid_actions()

try:
assert self.data.load(info_path, scenario_path), 'Failed to load info (%s) or scenario (%s)' % (info_path, scenario_path)
except Exception:
del self.em
raise

self.button_combos = self.data.valid_actions()
if use_restricted_actions == retro.Actions.DISCRETE:
combos = 1
for combo in self.button_combos:
Expand Down

0 comments on commit 7de79d8

Please sign in to comment.