Skip to content

Commit

Permalink
fix reset wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jun 7, 2024
1 parent 02a3556 commit d70da98
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pokemonred_puffer/wrappers/exploration.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def reset(self, *args, **kwargs):
self.env.unwrapped.seen_coords.update(
(k, self.fixed_value["coords"]) for k, v in self.env.unwrapped.seen_coords.items()
)
self.env.unwrapped.seen_map_ids *= self.fixed_value["map_ids"]
self.env.unwrapped.seen_map_ids[self.env.unwrapped.seen_map_ids > 0] = self.fixed_value[
"map_ids"
]
self.env.unwrapped.seen_npcs.update(
(k, self.fixed_value["npc"]) for k, v in self.env.unwrapped.seen_npcs.items()
)
Expand All @@ -139,5 +141,9 @@ def reset(self, *args, **kwargs):
self.env.unwrapped.cut_coords.update(
(k, self.fixed_value["cut"]) for k, v in self.env.unwrapped.seen_npcs.items()
)
self.env.unwrapped.explore_map = self.fixed_value["explore"]
self.cut_explore_map = self.fixed_value["cut"]
self.env.unwrapped.explore_map[self.env.unwrapped.explore_map > 0] = self.fixed_value[
"explore"
]
self.env.unwrapped.cut_explore_map[self.env.unwrapped.cut_explore_map > 0] = (
self.fixed_value["cut"]
)

0 comments on commit d70da98

Please sign in to comment.