diff --git a/modules/map_path.py b/modules/map_path.py index c34db70e..cb1afeef 100644 --- a/modules/map_path.py +++ b/modules/map_path.py @@ -237,7 +237,15 @@ def tile_index(x: int, y: int): destination = warp.destination_location extra_warp_direction = None if tile.tile_type.endswith(" Arrow Warp"): - extra_warp_direction = Direction[tile.tile_type.replace(" Arrow Warp", "")] + match tile.tile_type: + case "North Arrow Warp": + extra_warp_direction = Direction.North + case "South Arrow Warp" | "Water South Arrow Warp": + extra_warp_direction = Direction.South + case "East Arrow Warp": + extra_warp_direction = Direction.East + case "West Arrow Warp": + extra_warp_direction = Direction.West warps_to = ( (destination.map_group, destination.map_number), destination.local_position, diff --git a/modules/modes/util/walking.py b/modules/modes/util/walking.py index 9acb0aef..09194c36 100644 --- a/modules/modes/util/walking.py +++ b/modules/modes/util/walking.py @@ -139,12 +139,7 @@ def follow_waypoints(path: Iterable[Waypoint], run: bool = True) -> Generator: # this flag will just be ignored. # Similarly, running is not possible when surfing or swimming underwater, but pressing B can # cause the game to try and dive/emerge which we don't want. - if run and get_player_avatar().flags in ( - AvatarFlags.OnAcroBike, - AvatarFlags.OnMachBike, - AvatarFlags.Surfing, - AvatarFlags.Underwater, - ): + if run and (get_player_avatar().is_on_bike or get_player_avatar().is_in_water): run = False # For each waypoint (i.e. each step of the path) we set a timeout. If the player avatar does not reach the diff --git a/modules/player.py b/modules/player.py index 48cf526f..64fd950a 100644 --- a/modules/player.py +++ b/modules/player.py @@ -132,6 +132,10 @@ def flags(self) -> AvatarFlags: def is_on_bike(self) -> bool: return AvatarFlags.OnAcroBike in self.flags or AvatarFlags.OnMachBike in self.flags + @property + def is_in_water(self) -> bool: + return AvatarFlags.Surfing in self.flags or AvatarFlags.Underwater in self.flags + @property def running_state(self) -> RunningState: return RunningState(self._player_avatar_data[2])