From 2864134d79c5a176e570b54fe58974a3bec87eff Mon Sep 17 00:00:00 2001 From: remoitnane Date: Wed, 8 Sep 2010 01:37:20 -0700 Subject: Simplify party invitation logic and clean up comments This eliminates part of the client's burden to manage the ID of the player sending the invitation. This also introduces a new response value (3) for the invitation acknowledgement packet (0x00fd) to indicate the party is full. Resolves: TMW Mantis #676 --- src/map/clif.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 81a57f1..378f076 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5267,7 +5267,9 @@ int clif_party_info (struct party *p, int fd) } /*========================================== - * �p�[�e�B���U + * Relay a party invitation. + * + * (S 00fe .l .24B) *------------------------------------------ */ int clif_party_invite (struct map_session_data *sd, @@ -5281,7 +5283,7 @@ int clif_party_invite (struct map_session_data *sd, fd = tsd->fd; - if ((p = party_search (sd->status.party_id)) == NULL) + if (!(p = party_search (sd->status.party_id))) return 0; WFIFOW (fd, 0) = 0xfe; @@ -5292,7 +5294,16 @@ int clif_party_invite (struct map_session_data *sd, } /*========================================== - * �p�[�e�B���U���� + * Relay the response to a party invitation. + * + * (R 00fd .24B .B) + * + * flag: + * 0 The character is already in a party. + * 1 The invitation was rejected. + * 2 The invitation was accepted. + * 3 The party is full. + * 4 The character is in the same party. *------------------------------------------ */ int clif_party_inviteack (struct map_session_data *sd, char *nick, int flag) @@ -8442,17 +8453,20 @@ void clif_parse_CreateParty2 (int fd, struct map_session_data *sd) } /*========================================== - * �p�[�e�B�Ɋ��U + * Process invitation to join a party. + * + * (S 00fc .l) *------------------------------------------ */ void clif_parse_PartyInvite (int fd, struct map_session_data *sd) { - printf ("Party Invite!\n"); party_invite (sd, RFIFOL (fd, 2)); } /*========================================== - * �p�[�e�B���U�ԓ� + * Process reply to party invitation. + * + * (S 00ff .l .l) *------------------------------------------ */ void clif_parse_ReplyPartyInvite (int fd, struct map_session_data *sd) @@ -8464,7 +8478,7 @@ void clif_parse_ReplyPartyInvite (int fd, struct map_session_data *sd) } else { - party_reply_invite (sd, RFIFOL (fd, 2), -1); + party_reply_invite (sd, RFIFOL (fd, 2), 0); clif_skill_fail (sd, 1, 0, 4); } } -- cgit v1.2.3-60-g2f50