Skip to content

Commit

Permalink
Fix sceNpBasicSetPresence when data is nullptr and size is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
RipleyTom committed Jan 5, 2024
1 parent 2a1af17 commit 774710a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/Modules/sceNp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ error_code sceNpBasicSetPresence(vm::cptr<u8> data, u32 size)
}

// Not checked by API
ensure(data);
ensure(data || !size);

std::vector pr_data(data.get_ptr(), data.get_ptr() + size);
nph.set_presence(std::nullopt, pr_data);
Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/NP/np_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ namespace np

for (auto& [npid, pr_info] : current_presences)
{
// Only communicates info about online users with presence
if (!pr_info.online || pr_info.pr_com_id.data[0] == 0)
// Only communicates info about online users
if (!pr_info.online)
{
continue;
}
Expand Down

0 comments on commit 774710a

Please sign in to comment.