[XAM] Fixed XamUserCreateAchievementEnumerator starting index usage
Fixed Vancouver 2010 spamming XamUserCreateAchievementEnumerator
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <ranges>
|
||||||
|
|
||||||
#include "xenia/base/logging.h"
|
#include "xenia/base/logging.h"
|
||||||
#include "xenia/kernel/kernel_state.h"
|
#include "xenia/kernel/kernel_state.h"
|
||||||
#include "xenia/kernel/util/shim_utils.h"
|
#include "xenia/kernel/util/shim_utils.h"
|
||||||
@@ -593,20 +595,26 @@ dword_result_t XamUserCreateAchievementEnumerator_entry(
|
|||||||
kernel_state()->achievement_manager()->GetTitleAchievements(
|
kernel_state()->achievement_manager()->GetTitleAchievements(
|
||||||
requester_xuid, title_id_);
|
requester_xuid, title_id_);
|
||||||
|
|
||||||
if (!user_title_achievements.empty()) {
|
const auto requested_achievements = user_title_achievements |
|
||||||
for (const auto& entry : user_title_achievements) {
|
std::views::drop(offset) |
|
||||||
auto unlock_time = X_FILETIME();
|
std::views::take(count);
|
||||||
if (entry.IsUnlocked() && entry.unlock_time.is_valid()) {
|
|
||||||
unlock_time = entry.unlock_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto item = AchievementDetails(
|
if (requested_achievements.empty()) {
|
||||||
entry.achievement_id, entry.achievement_name.c_str(),
|
return X_ERROR_INVALID_PARAMETER;
|
||||||
entry.unlocked_description.c_str(), entry.locked_description.c_str(),
|
}
|
||||||
entry.image_id, entry.gamerscore, unlock_time, entry.flags);
|
|
||||||
|
|
||||||
e->AppendItem(item);
|
for (const auto& entry : requested_achievements) {
|
||||||
|
auto unlock_time = X_FILETIME();
|
||||||
|
if (entry.IsUnlocked() && entry.unlock_time.is_valid()) {
|
||||||
|
unlock_time = entry.unlock_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto item = AchievementDetails(
|
||||||
|
entry.achievement_id, entry.achievement_name.c_str(),
|
||||||
|
entry.unlocked_description.c_str(), entry.locked_description.c_str(),
|
||||||
|
entry.image_id, entry.gamerscore, unlock_time, entry.flags);
|
||||||
|
|
||||||
|
e->AppendItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
*handle_ptr = e->handle();
|
*handle_ptr = e->handle();
|
||||||
|
|||||||
Reference in New Issue
Block a user