diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-06 23:09:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-15 20:36:21 +0300 |
commit | 0a7e3dee7e935254ae5bbc9ac4520f8b56dafb90 (patch) | |
tree | 5e7f09dc1e42b2be04d7b250af460f408c5ead2c /src/map/clif.c | |
parent | 4635a32afe097f84b541d0d7980a5f607130d00c (diff) | |
download | hercules-0a7e3dee7e935254ae5bbc9ac4520f8b56dafb90.tar.gz hercules-0a7e3dee7e935254ae5bbc9ac4520f8b56dafb90.tar.bz2 hercules-0a7e3dee7e935254ae5bbc9ac4520f8b56dafb90.tar.xz hercules-0a7e3dee7e935254ae5bbc9ac4520f8b56dafb90.zip |
Update packet ZC_UPDATE_ITEM_FROM_BUYING_STORE.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 03e92340b..c279546b5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17837,28 +17837,23 @@ static void clif_buyingstore_trade_failed_buyer(struct map_session_data *sd, sho static void clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) { int fd; -#if PACKETVER < 20141016 // TODO : not sure for client date [Napster] - const int cmd = 0x81b; -#else - const int cmd = 0x9e6; -#endif - const int len = packet_len(cmd); + struct PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE p; nullpo_retv(sd); + fd = sd->fd; - WFIFOHEAD(fd, len); - WFIFOW(fd, 0) = cmd; - WFIFOW(fd, 2) = nameid; - WFIFOW(fd, 4) = amount; // amount of nameid received -#if PACKETVER < 20141016 - WFIFOL(fd, 6) = sd->buyingstore.zenylimit; -#else - WFIFOL(fd, 6) = zeny; // zeny - WFIFOL(fd, 10) = sd->buyingstore.zenylimit; - WFIFOL(fd, 14) = char_id; // GID - WFIFOL(fd, 18) = (int)time(NULL); // date + WFIFOHEAD(fd, sizeof(p)); + p.packetType = buyingStoreUpdateItemType; + p.itemId = nameid; + p.amount = amount; + p.zenyLimit = sd->buyingstore.zenylimit; +#if PACKETVER >= 20141016 + p.zeny = zeny; + p.charId = char_id; // GID + p.updateTime = (int)time(NULL); #endif - WFIFOSET(fd, len); + memcpy(WFIFOP(fd, 0), &p, sizeof(p)); + WFIFOSET(fd, sizeof(p)); } /// Deletes item from inventory, that was sold to a buying store (ZC_ITEM_DELETE_BUYING_STORE). |