From 5df75be04b28abcffa6813f3c8919ee58d6663cd Mon Sep 17 00:00:00 2001 From: otavepto Date: Tue, 5 Mar 2024 22:48:37 +0200 Subject: [PATCH] attempt to load the locked achievement icon from the json key `icongray` if the normal one failed, adding compatibility with older format --- dll/dll/steam_user_stats.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dll/dll/steam_user_stats.h b/dll/dll/steam_user_stats.h index 3dcd62ae..4f712f11 100644 --- a/dll/dll/steam_user_stats.h +++ b/dll/dll/steam_user_stats.h @@ -645,7 +645,10 @@ std::string get_achievement_icon_name( const char *pchName, bool pbAchieved ) try { if (pbAchieved) return it.value()["icon"].get(); - else return it.value()["icon_gray"].get(); + + std::string locked_icon = it.value().value("icon_gray", std::string()); + if (locked_icon.size()) return locked_icon; + else return it.value().value("icongray", std::string()); // old format } catch (...) {} return "";