Skip to content

Commit

Permalink
Revert map id scaling for hidden objs and signs
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Sep 13, 2024
1 parent 1438a00 commit 636ed7e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,19 +1244,22 @@ def insert_guard_drinks(self):
def sign_hook(self, *args, **kwargs):
sign_id = self.read_m("hSpriteIndexOrTextID")
map_id = self.read_m("wCurMap")
self.seen_signs[(map_id, sign_id)] = 1.0 if self.scale_map_id(map_id) else 0.0
# self.seen_signs[(map_id, sign_id)] = 1.0 if self.scale_map_id(map_id) else 0.0
self.seen_signs[(map_id, sign_id)] = 1.0

def hidden_object_hook(self, *args, **kwargs):
hidden_object_id = self.pyboy.memory[self.pyboy.symbol_lookup("wHiddenObjectIndex")[1]]
map_id = self.pyboy.memory[self.pyboy.symbol_lookup("wCurMap")[1]]
self.seen_hidden_objs[(map_id, hidden_object_id)] = (
1.0 if self.scale_map_id(map_id) else 0.0
)
# self.seen_hidden_objs[(map_id, hidden_object_id)] = (
# 1.0 if self.scale_map_id(map_id) else 0.0
# )
self.seen_hidden_objs[(map_id, hidden_object_id)] = 1.0

def sprite_hook(self, *args, **kwargs):
sprite_id = self.pyboy.memory[self.pyboy.symbol_lookup("hSpriteIndexOrTextID")[1]]
map_id = self.pyboy.memory[self.pyboy.symbol_lookup("wCurMap")[1]]
self.seen_npcs[(map_id, sprite_id)] = 1.0 if self.scale_map_id(map_id) else 0.0
# self.seen_npcs[(map_id, sprite_id)] = 1.0 if self.scale_map_id(map_id) else 0.0
self.seen_npcs[(map_id, sprite_id)] = 1.0

def start_menu_hook(self, *args, **kwargs):
if self.read_m("wIsInBattle") == 0:
Expand Down

0 comments on commit 636ed7e

Please sign in to comment.