Skip to content

Commit c656604

Browse files
steampp: fix being unable to load a game's library assets if the user has used multiple languages in steam
1 parent d18a75f commit c656604

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/steampp/steampp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,17 @@ bool isAppUsingEngine(const Steam* steam, AppID appID) {
110110

111111
[[nodiscard]] std::string getAppArtPath(const KV1Binary& assetCache, AppID appID, std::string_view steamInstallDir, std::string_view id) {
112112
if (
113-
assetCache.getChildCount() != 1 ||
114-
assetCache[0].getChildCount() != 3 ||
115-
!assetCache[0].hasChild("cache_version") ||
113+
!assetCache[0].hasChild("cache_version") || !assetCache[0].hasChild("0") ||
116114
static_cast<KV1BinaryValueType>(assetCache[0]["cache_version"].getValue().index()) != KV1BinaryValueType::INT32 ||
117115
*assetCache[0]["cache_version"].getValue<int32_t>() != 2
118116
) {
119117
return "";
120118
}
121119
const auto idStr = std::format("{}", appID);
122-
const auto& cache = assetCache[0][2][idStr];
120+
// note: the "0" here means use the english version of the library assets. there's no easily accessible way to grab
121+
// the user's steam language or figure out what index each language is as far as i can tell, so I will use this hack instead.
122+
// if the asset exists, there will always be a base english asset present so no need to search for language overrides
123+
const auto& cache = assetCache[0]["0"][idStr];
123124
if (cache.isInvalid() || !cache.hasChild(id)) {
124125
return "";
125126
}

0 commit comments

Comments
 (0)