mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Fix sceNpScoreGetRankingByNpId when no score is registered
This commit is contained in:
parent
73cee9a43d
commit
c68f42e0ee
@ -1182,6 +1182,8 @@ namespace np
|
|||||||
vm::ptr<SceNpScoreRankData> rankArray = vm::static_ptr_cast<SceNpScoreRankData>(tdata->rankArray);
|
vm::ptr<SceNpScoreRankData> rankArray = vm::static_ptr_cast<SceNpScoreRankData>(tdata->rankArray);
|
||||||
vm::ptr<SceNpScoreRankData_deprecated> rankArray_deprecated = vm::static_ptr_cast<SceNpScoreRankData_deprecated>(tdata->rankArray);
|
vm::ptr<SceNpScoreRankData_deprecated> rankArray_deprecated = vm::static_ptr_cast<SceNpScoreRankData_deprecated>(tdata->rankArray);
|
||||||
|
|
||||||
|
u32 num_scores_registered = 0;
|
||||||
|
|
||||||
for (flatbuffers::uoffset_t i = 0; i < fb_rankarray->size(); i++)
|
for (flatbuffers::uoffset_t i = 0; i < fb_rankarray->size(); i++)
|
||||||
{
|
{
|
||||||
const auto* fb_rankdata = fb_rankarray->Get(i);
|
const auto* fb_rankdata = fb_rankarray->Get(i);
|
||||||
@ -1190,6 +1192,8 @@ namespace np
|
|||||||
if (fb_rankdata->recordDate() == 0)
|
if (fb_rankdata->recordDate() == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
num_scores_registered++;
|
||||||
|
|
||||||
if (tdata->player_rank_data)
|
if (tdata->player_rank_data)
|
||||||
{
|
{
|
||||||
if (tdata->deprecated)
|
if (tdata->deprecated)
|
||||||
@ -1262,7 +1266,7 @@ namespace np
|
|||||||
tdata->lastSortDate->tick = resp->lastSortDate();
|
tdata->lastSortDate->tick = resp->lastSortDate();
|
||||||
*tdata->totalRecord = resp->totalRecord();
|
*tdata->totalRecord = resp->totalRecord();
|
||||||
|
|
||||||
if (fb_rankarray->size())
|
if (num_scores_registered)
|
||||||
score_trans->result = simple_result ? CELL_OK : not_an_error(fb_rankarray->size());
|
score_trans->result = simple_result ? CELL_OK : not_an_error(fb_rankarray->size());
|
||||||
else
|
else
|
||||||
score_trans->result = SCE_NP_COMMUNITY_SERVER_ERROR_GAME_RANKING_NOT_FOUND;
|
score_trans->result = SCE_NP_COMMUNITY_SERVER_ERROR_GAME_RANKING_NOT_FOUND;
|
||||||
|
Loading…
Reference in New Issue
Block a user