From f47bbfce4aa10626b6d36ca2e7975a7b9f8aaa6b Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 28 Oct 2022 18:36:45 +0200 Subject: [PATCH] "Fixed" `--run-game` flag work Yes I just added 5 secs delay before closing the app. It works so don't care --- src/lib/game.rs | 3 +-- src/main.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/game.rs b/src/lib/game.rs index f62a350..66cc488 100644 --- a/src/lib/game.rs +++ b/src/lib/game.rs @@ -1,4 +1,3 @@ -use std::path::Path; use std::process::Command; use anime_game_core::genshin::telemetry; @@ -67,7 +66,7 @@ pub fn try_get_terminal() -> Option { pub fn run() -> anyhow::Result<()> { let config = config::get()?; - if !Path::new(&config.game.path).exists() { + if !config.game.path.exists() { return Err(anyhow::anyhow!("Game is not installed")); } diff --git a/src/main.rs b/src/main.rs index bc323a2..8a5656f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,6 +112,7 @@ fn main() { lib::launcher::states::LauncherState::Launch => { main.update(ui::main::Actions::PerformButtonEvent).unwrap(); + std::thread::sleep(std::time::Duration::from_secs(5)); std::process::exit(0); }, _ => main.show()