From ad1596b023600f31ac036ae3765664c25ba64cdb Mon Sep 17 00:00:00 2001 From: Matthew Stanger Date: Thu, 16 May 2024 22:30:56 -0700 Subject: [PATCH] fix pokemon tilemap wapper for 2.0 2.0 introduced a new method for getting the screen tile map, this commit simply swaps the old 1.x API for the new 2.x API per API doc: https://docs.pyboy.dk/api/screen.html#pyboy.api.screen. Screen.get_tilemap_position Signed-off-by: Matthew Stanger --- pyboy/plugins/game_wrapper_pokemon_gen1.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyboy/plugins/game_wrapper_pokemon_gen1.py b/pyboy/plugins/game_wrapper_pokemon_gen1.py index 4b47e4717..551ea7d7e 100644 --- a/pyboy/plugins/game_wrapper_pokemon_gen1.py +++ b/pyboy/plugins/game_wrapper_pokemon_gen1.py @@ -44,9 +44,8 @@ def post_tick(self): def _get_screen_background_tilemap(self): ### SIMILAR TO CURRENT pyboy.game_wrapper.game_area(), BUT ONLY FOR BACKGROUND TILEMAP, SO NPC ARE SKIPPED - bsm = self.pyboy.botsupport_manager() - ((scx, scy), (wx, wy)) = bsm.screen().tilemap_position() - tilemap = np.array(bsm.tilemap_background[:, :]) + ((scx, scy), (wx, wy)) = self.pyboy.screen.get_tilemap_position() + tilemap = np.array(self.pyboy.tilemap_background[:, :]) return np.roll(np.roll(tilemap, -scy // 8, axis=0), -scx // 8, axis=1)[:18, :20] def _get_screen_walkable_matrix(self):