From bc595911f67b8f777ea26724d631d5074ad05956 Mon Sep 17 00:00:00 2001 From: lb_ii Date: Fri, 4 Jun 2021 04:37:26 +0300 Subject: [PATCH] WINTERMUTE: Use AchMan to get achivements descriptions --- engines/wintermute/ext/wme_steam.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/wintermute/ext/wme_steam.cpp b/engines/wintermute/ext/wme_steam.cpp index 88b6b4c84a3..0577781535f 100644 --- a/engines/wintermute/ext/wme_steam.cpp +++ b/engines/wintermute/ext/wme_steam.cpp @@ -119,8 +119,9 @@ bool SXSteamAPI::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta stack->correctParams(1); uint32 index = (uint32) stack->pop()->getInt(); - if (index < _achievementsInfo.descriptions.size()) { - stack->pushString(_achievementsInfo.descriptions[index].id); + const Common::AchievementDescription *descr = AchMan.getAchievementDescription(index); + if (descr) { + stack->pushString(descr->id.c_str()); } else { stack->pushNULL(); } @@ -212,7 +213,7 @@ ScValue *SXSteamAPI::scGetProperty(const Common::String &name) { // NumAchievements (RO) ////////////////////////////////////////////////////////////////////////// else if (name == "NumAchievements") { - _scValue->setInt(_achievementsInfo.descriptions.size()); + _scValue->setInt(AchMan.getAchievementCount()); return _scValue; } //////////////////////////////////////////////////////////////////////////