From 311470a29dbbc4c31ef90853e13f2a5c83eaf475 Mon Sep 17 00:00:00 2001 From: Eisai <12467320+Eisaichen@users.noreply.github.com> Date: Thu, 6 Jun 2024 23:55:11 -0700 Subject: [PATCH] =?UTF-8?q?=20feat:=20=E6=94=AF=E6=8C=81B=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 传递游戏是传递“Start in”参数 fix https://github.com/moesnow/March7thAssistant/issues/261 --- utils/gamecontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/gamecontroller.py b/utils/gamecontroller.py index f3a2b95d..65cda9a6 100644 --- a/utils/gamecontroller.py +++ b/utils/gamecontroller.py @@ -42,7 +42,8 @@ def start_game(self) -> bool: self.log_error(f"游戏路径不存在:{self.game_path}") return False - if not os.system(f'cmd /C start "" "{self.game_path}"'): + game_folder = self.game_path.rpartition('\\')[0] + if not os.system(f'cmd /C start "" /D "{game_folder}" "{self.game_path}"'): self.log_info(f"游戏启动:{self.game_path}") return True else: