From 2da3274036ea7db9a1e162e6898d8ac0a4b5d8c0 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:17:32 -0400 Subject: [PATCH] fix --- pokemonred_puffer/environment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index 6c071fa..abcf0f6 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -1527,10 +1527,10 @@ def get_required_events(self) -> set[str]: ) def get_required_items(self) -> set[str]: - _, wNumBagItems = self.pyboy.symbol_lookup("wNumBagItems") + wNumBagItems = self.read_m("wNumBagItems") _, wBagItems = self.pyboy.symbol_lookup("wBagItems") - bag_items = self.pyboy.memory[wBagItems : wBagItems + wNumBagItems * 2] - return {Items(item).name for item in bag_items[::2] if Items(item) in REQUIRED_ITEMS} + bag_items = self.pyboy.memory[wBagItems : wBagItems + wNumBagItems * 2 : 2] + return {Items(item).name for item in bag_items if Items(item) in REQUIRED_ITEMS} def get_events_sum(self): # adds up all event flags, exclude museum ticket