Skip to content

Commit

Permalink
added try to local_to_global
Browse files Browse the repository at this point in the history
  • Loading branch information
kywch committed Mar 20, 2024
1 parent 7ef770f commit 14f9169
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def init_mem(self):
self.seen_hidden_objs = {}

self.cut_coords = {}
self.cut_tiles = set([])
self.cut_tiles = {} # set([])
self.cut_state = deque(maxlen=3)

self.seen_start_menu = 0
Expand Down Expand Up @@ -809,7 +809,11 @@ def update_seen_coords(self):
x_pos, y_pos, map_n = self.get_game_coords()
self.seen_coords[(x_pos, y_pos, map_n)] = 1
self.seen_coords_since_blackout.add((x_pos, y_pos, map_n))
self.explore_map[local_to_global(y_pos, x_pos, map_n)] = 1
try:
self.explore_map[local_to_global(y_pos, x_pos, map_n)] = 1
except IndexError:
gy, gx = local_to_global(y_pos, x_pos, map_n)
print(f"coord out of bounds! global: ({gx}, {gy}) game: ({x_pos}, {y_pos}, {map_n})")
# self.seen_global_coords[local_to_global(y_pos, x_pos, map_n)] = 1
self.seen_map_ids[map_n] = 1
self.seen_map_ids_since_blackout.add(map_n)
Expand Down

0 comments on commit 14f9169

Please sign in to comment.