From dc1b3a43689e900c72e4331785a3badaeec61586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= Date: Sat, 11 Apr 2026 15:00:10 +0800 Subject: [PATCH] Revert "revert: remove enable_mount option from CoordinatePatrol" This reverts commit 9af6ac4a512de92a81bdc5ab3b0ac9ad340f42d9. --- coordinate_patrol.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coordinate_patrol.py b/coordinate_patrol.py index a6d28a8..88ef947 100644 --- a/coordinate_patrol.py +++ b/coordinate_patrol.py @@ -28,6 +28,7 @@ class CoordinatePatrol: mount_key="x", mount_hold_sec=1.6, mount_retry_after_sec=2.0, + enable_mount=True, ): """ Args: @@ -36,6 +37,7 @@ class CoordinatePatrol: angle_threshold_deg: 朝向容差(度),超过此值才按 A/D 转向,默认 ANGLE_THRESHOLD_DEG angle_deadzone_deg: 转向死区(度),此范围内不按 A/D、只按 W,默认 ANGLE_DEADZONE_DEG mount_key / mount_hold_sec / mount_retry_after_sec: 未上马时先上马(与 game_state_config / GUI 一致) + enable_mount: False 时跳过上马操作 """ self.waypoints = waypoints self.current_index = 0 @@ -47,6 +49,7 @@ class CoordinatePatrol: self.last_turn_end_time = 0 # 最近一次结束 A/D 转向的时间,供卡死检测排除原地转向 self.stuck_handler = StuckHandler() self._next_mount_allowed = 0.0 + self.enable_mount = bool(enable_mount) self.mount_key = str(mount_key).strip() or "x" self.mount_hold_sec = float(mount_hold_sec) self.mount_retry_after_sec = float(mount_retry_after_sec) @@ -60,6 +63,8 @@ class CoordinatePatrol: """ if "mounted" not in state: return True + if not self.enable_mount: + return True if state.get("mounted"): return True # game_state.death_state: 0 存活 / 1 尸体 / 2 灵魂 — 幽灵无法/不需上马,不得拦走路