partyMax is mandatory if partySize is included (#122)

This commit is contained in:
Mason Sciotti 2018-02-12 13:44:49 -08:00 committed by GitHub
parent c4201806cf
commit 453222075b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,14 +138,12 @@ size_t JsonWriteRichPresenceObj(char* dest,
presence->partyMax) { presence->partyMax) {
WriteObject party(writer, "party"); WriteObject party(writer, "party");
WriteOptionalString(writer, "id", presence->partyId); WriteOptionalString(writer, "id", presence->partyId);
if (presence->partySize) { if (presence->partySize && presence->partyMax) {
WriteArray size(writer, "size"); WriteArray size(writer, "size");
writer.Int(presence->partySize); writer.Int(presence->partySize);
if (0 < presence->partyMax) {
writer.Int(presence->partyMax); writer.Int(presence->partyMax);
} }
} }
}
if ((presence->matchSecret && presence->matchSecret[0]) || if ((presence->matchSecret && presence->matchSecret[0]) ||
(presence->joinSecret && presence->joinSecret[0]) || (presence->joinSecret && presence->joinSecret[0]) ||