Skip to content

Commit

Permalink
fix simpler bag obs
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jun 16, 2024
1 parent 289f539 commit 37cfe60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ def _get_obs(self):
# player_x, player_y, map_n = self.get_game_coords()
_, wBagItems = self.pyboy.symbol_lookup("wBagItems")
bag = np.array(self.pyboy.memory[wBagItems : wBagItems + 40])
numBagItems = self.pyboy.symbol_lookup("wNumBagItems")
numBagItems = self.read_m("wNumBagItems")
# item ids start at 1 so using 0 as the nothing value is okay
bag[2 * numBagItems :] = 0

return {
Expand Down

0 comments on commit 37cfe60

Please sign in to comment.