diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-10 03:05:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-15 20:36:25 +0300 |
commit | cc1aa52722516e2d903578faf214ddf85979feb8 (patch) | |
tree | ac621f56bad779f1e7579ac0e25aa76f56c15fa7 /src/map/clif.c | |
parent | 38857e6e0b70aba7f8d0438fe7ebb41dc96b4cda (diff) | |
download | hercules-cc1aa52722516e2d903578faf214ddf85979feb8.tar.gz hercules-cc1aa52722516e2d903578faf214ddf85979feb8.tar.bz2 hercules-cc1aa52722516e2d903578faf214ddf85979feb8.tar.xz hercules-cc1aa52722516e2d903578faf214ddf85979feb8.zip |
Update packet ZC_MYITEMLIST_BUYING_STORE.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 9be2def2e..992525107 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17657,24 +17657,28 @@ static void clif_buyingstore_myitemlist(struct map_session_data *sd) { int fd; unsigned int i; + struct PACKET_ZC_MYITEMLIST_BUYING_STORE *p; + int len; nullpo_retv(sd); fd = sd->fd; - WFIFOHEAD(fd,12+sd->buyingstore.slots*9); - WFIFOW(fd,0) = 0x813; - WFIFOW(fd,2) = 12+sd->buyingstore.slots*9; - WFIFOL(fd,4) = sd->bl.id; - WFIFOL(fd,8) = sd->buyingstore.zenylimit; + len = sizeof(struct PACKET_ZC_MYITEMLIST_BUYING_STORE) + sd->buyingstore.slots * sizeof(struct PACKET_ZC_MYITEMLIST_BUYING_STORE_sub); + WFIFOHEAD(fd, len); + p = WFIFOP(fd, 0); + p->packetType = 0x813; + p->packetLength = len; + p->AID = sd->bl.id; + p->zenyLimit = sd->buyingstore.zenylimit; - for( i = 0; i < sd->buyingstore.slots; i++ ) + for (i = 0; i < sd->buyingstore.slots; i++) { - WFIFOL(fd,12+i*9) = sd->buyingstore.items[i].price; - WFIFOW(fd,16+i*9) = sd->buyingstore.items[i].amount; - WFIFOB(fd,18+i*9) = itemtype(itemdb_type(sd->buyingstore.items[i].nameid)); - WFIFOW(fd,19+i*9) = sd->buyingstore.items[i].nameid; + p->items[i].price = sd->buyingstore.items[i].price; + p->items[i].amount = sd->buyingstore.items[i].amount; + p->items[i].itemType = itemtype(itemdb_type(sd->buyingstore.items[i].nameid)); + p->items[i].itemId = sd->buyingstore.items[i].nameid; } - WFIFOSET(fd,WFIFOW(fd,2)); + WFIFOSET(fd, len); } /// Notifies clients in area of a buying store (ZC_BUYING_STORE_ENTRY). |