diff --git a/src/game/mod.rs b/src/game/mod.rs index f271a75..04b338e 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -218,14 +218,19 @@ impl Game { // one or deinited(so we can't create the console-only logger and replace it by the // console&file logger after FilesystemContainer has been initialized) fn get_logs_dir() -> GameResult { - let mut logs_dir = PathBuf::new(); - - + let mut logs_dir: PathBuf; + + #[cfg(target_os = "android")] { logs_dir = PathBuf::from(ndk_glue::native_activity().internal_data_path().to_string_lossy().to_string()); } - + + #[cfg(target_os = "horizon")] + { + logs_dir = PathBuf::from("sdmc:/switch/doukutsu-rs"); + } + #[cfg(not(any(target_os = "android", target_os = "horizon")))] { let project_dirs = match directories::ProjectDirs::from("", "", "doukutsu-rs") { @@ -237,19 +242,13 @@ fn get_logs_dir() -> GameResult { ))); } }; - + logs_dir = project_dirs.data_local_dir().to_path_buf(); } - - #[cfg(target_os = "horizon")] - { - logs_dir = PathBuf::from("sdmc:/switch/doukutsu-rs"); - } - - - + logs_dir.push("logs"); - + + Ok(logs_dir) } diff --git a/src/game/shared_game_state.rs b/src/game/shared_game_state.rs index c745b2d..6f2c416 100644 --- a/src/game/shared_game_state.rs +++ b/src/game/shared_game_state.rs @@ -451,6 +451,7 @@ impl SharedGameState { let more_rust = (current_time.month() == 7 && current_time.day() == 7) || settings.more_rust; let seed = chrono::Local::now().timestamp() as i32; + #[cfg(feature = "discord-rpc")] let discord_rpc_app_id = match option_env!("DISCORD_RPC_APP_ID") { Some(app_id) => app_id, None => "1076523467337367622",