From 46ecbb6485c6ee6dea926265b509506f46a0adf6 Mon Sep 17 00:00:00 2001 From: Tino Date: Mon, 13 Jan 2025 21:42:40 +0700 Subject: [PATCH] Do not press B when surfing/underwater (#613) --- modules/modes/util/walking.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/modes/util/walking.py b/modules/modes/util/walking.py index 818773d5..9acb0aef 100644 --- a/modules/modes/util/walking.py +++ b/modules/modes/util/walking.py @@ -16,6 +16,7 @@ player_is_at, get_player_location, AvatarFlags, + PlayerAvatar, ) from modules.tasks import get_global_script_context, task_is_active from .sleep import wait_for_n_frames @@ -136,7 +137,14 @@ def follow_waypoints(path: Iterable[Waypoint], run: bool = True) -> Generator: # 'Running' means holding B, which on the Acro Bike leads to doing a Wheelie which is actually # slower than normal riding. On other bikes it just doesn't do anything, so if we are riding one, # this flag will just be ignored. - if run and get_player_avatar().is_on_bike: + # 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, + ): run = False # For each waypoint (i.e. each step of the path) we set a timeout. If the player avatar does not reach the