diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-10 05:21:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-15 20:36:25 +0300 |
commit | d172c28f9b25a780235c7c7a7f4db9ca9866f531 (patch) | |
tree | 070d497a7b61002123c8934d13bb96894e11bfee /src/map/clif.c | |
parent | 31d6cdc4cba0d8da14474c3120a2260b3f41d9f5 (diff) | |
download | hercules-d172c28f9b25a780235c7c7a7f4db9ca9866f531.tar.gz hercules-d172c28f9b25a780235c7c7a7f4db9ca9866f531.tar.bz2 hercules-d172c28f9b25a780235c7c7a7f4db9ca9866f531.tar.xz hercules-d172c28f9b25a780235c7c7a7f4db9ca9866f531.zip |
Update packet ZC_ACK_ITEMLIST_BUYING_STORE.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 265757220..5560eaa25 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17754,26 +17754,30 @@ static void clif_buyingstore_itemlist(struct map_session_data *sd, struct map_se { int fd; unsigned int i; + struct PACKET_ZC_ACK_ITEMLIST_BUYING_STORE *p; + int len; nullpo_retv(sd); nullpo_retv(pl_sd); fd = sd->fd; - WFIFOHEAD(fd,16+pl_sd->buyingstore.slots*9); - WFIFOW(fd,0) = 0x818; - WFIFOW(fd,2) = 16+pl_sd->buyingstore.slots*9; - WFIFOL(fd,4) = pl_sd->bl.id; - WFIFOL(fd,8) = pl_sd->buyer_id; - WFIFOL(fd,12) = pl_sd->buyingstore.zenylimit; - - for( i = 0; i < pl_sd->buyingstore.slots; i++ ) + len = sizeof(struct PACKET_ZC_ACK_ITEMLIST_BUYING_STORE) + pl_sd->buyingstore.slots * sizeof(struct PACKET_ZC_ACK_ITEMLIST_BUYING_STORE_sub); + WFIFOHEAD(fd, len); + p = WFIFOP(fd, 0); + p->packetType = 0x818; + p->packetLength = len; + p->AID = pl_sd->bl.id; + p->storeId = pl_sd->buyer_id; + p->zenyLimit = pl_sd->buyingstore.zenylimit; + + for (i = 0; i < pl_sd->buyingstore.slots; i++) { - WFIFOL(fd,16+i*9) = pl_sd->buyingstore.items[i].price; - WFIFOW(fd,20+i*9) = pl_sd->buyingstore.items[i].amount; // TODO: Figure out, if no longer needed items (amount == 0) are listed on official. - WFIFOB(fd,22+i*9) = itemtype(itemdb_type(pl_sd->buyingstore.items[i].nameid)); - WFIFOW(fd,23+i*9) = pl_sd->buyingstore.items[i].nameid; + p->items[i].price = pl_sd->buyingstore.items[i].price; + p->items[i].amount = pl_sd->buyingstore.items[i].amount; // TODO: Figure out, if no longer needed items (amount == 0) are listed on official. + p->items[i].itemType = itemtype(itemdb_type(pl_sd->buyingstore.items[i].nameid)); + p->items[i].itemId = pl_sd->buyingstore.items[i].nameid; } - WFIFOSET(fd,WFIFOW(fd,2)); + WFIFOSET(fd, len); } static void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); |