mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 03:08:36 +12:00
sceNpTrophyGetGameProgress Fix
This commit is contained in:
parent
0c8611bd49
commit
1f94c8f272
1 changed files with 6 additions and 3 deletions
|
@ -1064,10 +1064,13 @@ error_code sceNpTrophyGetGameProgress(u32 context, u32 handle, vm::ptr<s32> perc
|
||||||
const u32 unlocked = ctxt->tropusr->GetUnlockedTrophiesCount();
|
const u32 unlocked = ctxt->tropusr->GetUnlockedTrophiesCount();
|
||||||
const u32 trp_count = ctxt->tropusr->GetTrophiesCount();
|
const u32 trp_count = ctxt->tropusr->GetTrophiesCount();
|
||||||
|
|
||||||
verify(HERE), trp_count > 0 && trp_count <= 128;
|
// Round result to nearest (TODO: Check 0 trophies)
|
||||||
|
*percentage = trp_count ? ::rounded_div(unlocked * 100, trp_count) : 0;
|
||||||
|
|
||||||
// Round result to nearest
|
if (trp_count == 0 || trp_count > 128)
|
||||||
*percentage = rounded_div(unlocked * 100, trp_count);
|
{
|
||||||
|
sceNpTrophy.warning("sceNpTrophyGetGameProgress(): Trophies count may be invalid or untested (%d)", trp_count);
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue