diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-05 05:31:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-12 02:29:12 +0300 |
commit | 2f2ceeb24b8d469b98b410772563731d5921e470 (patch) | |
tree | 0a3b1cc8c046b524feaad47a14b9241afe3ec69e /src/map/clif.c | |
parent | 3eeda93ef807f1753ff97f089d0c158a8ca85ebb (diff) | |
download | hercules-2f2ceeb24b8d469b98b410772563731d5921e470.tar.gz hercules-2f2ceeb24b8d469b98b410772563731d5921e470.tar.bz2 hercules-2f2ceeb24b8d469b98b410772563731d5921e470.tar.xz hercules-2f2ceeb24b8d469b98b410772563731d5921e470.zip |
Add packet struct ZC_ADD_ITEM_TO_STORE and update packet for latest RE client.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index e6aadc80f..6723cbe9f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4311,31 +4311,32 @@ static void clif_updatestorageamount(struct map_session_data *sd, int amount, in /// 01c4 <index>.W <amount>.L <nameid>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_STORE2) static void clif_storageitemadded(struct map_session_data *sd, struct item *i, int index, int amount) { - int view,fd; - int offset = 0; + int view, fd; + struct PACKET_ZC_ADD_ITEM_TO_STORE p; nullpo_retv(sd); nullpo_retv(i); - fd=sd->fd; + + fd = sd->fd; view = itemdb_viewid(i->nameid); - WFIFOHEAD(fd,packet_len(storageaddType)); - WFIFOW(fd, 0) = storageaddType; // Storage item added - WFIFOW(fd, 2) = index+1; // index - WFIFOL(fd, 4) = amount; // amount - WFIFOW(fd, 8) = ( view > 0 ) ? view : i->nameid; // id + WFIFOHEAD(fd, sizeof(p)); + p.packetType = storageaddType; // Storage item added + p.index = index + 1; // index + p.amount = amount; // amount + p.itemId = (view > 0) ? view : i->nameid; // id #if PACKETVER >= 5 - WFIFOB(fd,10) = itemtype(itemdb_type(i->nameid)); //type - offset += 1; + p.itemType = itemtype(itemdb_type(i->nameid)); //type #endif - WFIFOB(fd,10+offset) = i->identify; //identify flag - WFIFOB(fd,11+offset) = i->attribute; // attribute - WFIFOB(fd,12+offset) = i->refine; //refine - clif->addcards((struct EQUIPSLOTINFO*)WFIFOP(fd, 13 + offset), i); + p.identified = i->identify; //identify flag + p.damaged = i->attribute; // attribute + p.refine = i->refine; //refine + clif->addcards(&p.slot, i); #if PACKETVER >= 20150226 - clif->add_item_options(WFIFOP(fd, 21 + offset), i); + clif->add_item_options(&p.option_data[0], i); #endif - WFIFOSET(fd,packet_len(storageaddType)); + memcpy(WFIFOP(fd, 0), &p, sizeof(p)); + WFIFOSET(fd, sizeof(p)); } /// Notifies the client of an item being deleted from the storage (ZC_DELETE_ITEM_FROM_STORE). |