sceNpTrophy: deny unlocking of platinum trophies

This commit is contained in:
Megamouse 2020-01-06 09:47:11 +01:00
parent 765bd6b6c6
commit be2d225d96
3 changed files with 22 additions and 0 deletions

View file

@ -819,9 +819,19 @@ error_code sceNpTrophyUnlockTrophy(u32 context, u32 handle, s32 trophyId, vm::pt
}
if (trophyId < 0 || trophyId >= static_cast<s32>(ctxt->tropusr->GetTrophiesCount()))
{
return SCE_NP_TROPHY_ERROR_INVALID_TROPHY_ID;
}
if (ctxt->tropusr->GetTrophyGrade(trophyId) == SCE_NP_TROPHY_GRADE_PLATINUM)
{
return SCE_NP_TROPHY_ERROR_CANNOT_UNLOCK_PLATINUM;
}
if (ctxt->tropusr->GetTrophyUnlockState(trophyId))
{
return SCE_NP_TROPHY_ERROR_ALREADY_UNLOCKED;
}
ctxt->tropusr->UnlockTrophy(trophyId, 0, 0); // TODO: add timestamps