diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 1aee4fc1d..e3e659234 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -14225,22 +14225,30 @@ int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap) /// Sends the whole friends list (ZC_FRIENDS_LIST). /// 0201 <packet len>.W { <account id>.L <char id>.L <name>.24B }* +/// 0201 <packet len>.W { <account id>.L <char id>.L }* void clif_friendslist_send(struct map_session_data *sd) { int i = 0, n, fd = sd->fd; +#if !defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221)) + const int offset = 8; +#else + const int offset = 32; +#endif nullpo_retv(sd); // Send friends list - WFIFOHEAD(fd, MAX_FRIENDS * 32 + 4); + WFIFOHEAD(fd, MAX_FRIENDS * offset + 4); WFIFOW(fd, 0) = 0x201; for(i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id; i++) { - WFIFOL(fd, 4 + 32 * i + 0) = sd->status.friends[i].account_id; - WFIFOL(fd, 4 + 32 * i + 4) = sd->status.friends[i].char_id; - memcpy(WFIFOP(fd, 4 + 32 * i + 8), &sd->status.friends[i].name, NAME_LENGTH); + WFIFOL(fd, 4 + offset * i + 0) = sd->status.friends[i].account_id; + WFIFOL(fd, 4 + offset * i + 4) = sd->status.friends[i].char_id; +#if !(!defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221))) + memcpy(WFIFOP(fd, 4 + offset * i + 8), &sd->status.friends[i].name, NAME_LENGTH); +#endif } if (i) { - WFIFOW(fd,2) = 4 + 32 * i; + WFIFOW(fd,2) = 4 + offset * i; WFIFOSET(fd, WFIFOW(fd,2)); } |