From 6a1710eee140201d043f8bf27df087eb474849fd Mon Sep 17 00:00:00 2001 From: Detanup01 <91248446+Detanup01@users.noreply.github.com> Date: Sun, 6 Oct 2024 17:50:29 +0200 Subject: [PATCH 1/2] adding fallback for image path "achievement_images" --- dll/steam_user_stats_achievements.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dll/steam_user_stats_achievements.cpp b/dll/steam_user_stats_achievements.cpp index 512edb89..883a1e55 100644 --- a/dll/steam_user_stats_achievements.cpp +++ b/dll/steam_user_stats_achievements.cpp @@ -98,9 +98,15 @@ int Steam_User_Stats::load_ach_icon(nlohmann::json &defined_ach, bool achieved) std::string file_path(Local_Storage::get_game_settings_path() + icon_filepath); unsigned int file_size = file_size_(file_path); - if (!file_size) { - defined_ach[icon_handle_key] = Settings::INVALID_IMAGE_HANDLE; - return Settings::INVALID_IMAGE_HANDLE; + if (!file_size) + { + file_path(Local_Storage::get_game_settings_path() + "achievement_images" + PATH_SEPARATOR + icon_filepath); + file_size = file_size_(file_path); + if (!file_size) + { + defined_ach[icon_handle_key] = Settings::INVALID_IMAGE_HANDLE; + return Settings::INVALID_IMAGE_HANDLE; + } } int icon_size = static_cast(settings->overlay_appearance.icon_size); From 601102d8a55323626d716bdc010758ce90a8dce9 Mon Sep 17 00:00:00 2001 From: Detanup01 <91248446+Detanup01@users.noreply.github.com> Date: Sun, 6 Oct 2024 18:03:37 +0200 Subject: [PATCH 2/2] fix file_path --- dll/steam_user_stats_achievements.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/steam_user_stats_achievements.cpp b/dll/steam_user_stats_achievements.cpp index 883a1e55..a0577188 100644 --- a/dll/steam_user_stats_achievements.cpp +++ b/dll/steam_user_stats_achievements.cpp @@ -100,7 +100,7 @@ int Steam_User_Stats::load_ach_icon(nlohmann::json &defined_ach, bool achieved) unsigned int file_size = file_size_(file_path); if (!file_size) { - file_path(Local_Storage::get_game_settings_path() + "achievement_images" + PATH_SEPARATOR + icon_filepath); + file_path = (Local_Storage::get_game_settings_path() + "achievement_images" + PATH_SEPARATOR + icon_filepath); file_size = file_size_(file_path); if (!file_size) {