diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-05 19:33:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-12 02:29:12 +0300 |
commit | c6871ff29e0e6d58f6915aafaf1b86e464aae623 (patch) | |
tree | 4443ad8120ea3be7ca083b600ebe167eca697ad4 /src/map | |
parent | 2f2ceeb24b8d469b98b410772563731d5921e470 (diff) | |
download | hercules-c6871ff29e0e6d58f6915aafaf1b86e464aae623.tar.gz hercules-c6871ff29e0e6d58f6915aafaf1b86e464aae623.tar.bz2 hercules-c6871ff29e0e6d58f6915aafaf1b86e464aae623.tar.xz hercules-c6871ff29e0e6d58f6915aafaf1b86e464aae623.zip |
Update packet ZC_MVP_GETTING_ITEM.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 19 | ||||
-rw-r--r-- | src/map/packets_struct.h | 9 |
2 files changed, 20 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 6723cbe9f..943c166a7 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7496,20 +7496,23 @@ static void clif_mvp_effect(struct map_session_data *sd) /// MVP item reward message (ZC_MVP_GETTING_ITEM). /// 010a <name id>.W +/// 010a <name id>.L static void clif_mvp_item(struct map_session_data *sd, int nameid) { - int view,fd; + int view, fd; + struct PACKET_ZC_MVP_GETTING_ITEM p; nullpo_retv(sd); - fd=sd->fd; - WFIFOHEAD(fd,packet_len(0x10a)); - WFIFOW(fd,0)=0x10a; - if((view = itemdb_viewid(nameid)) > 0) - WFIFOW(fd,2)=view; + fd = sd->fd; + WFIFOHEAD(fd, sizeof(p)); + p.packetType = 0x10a; + if ((view = itemdb_viewid(nameid)) > 0) + p.itemId = view; else - WFIFOW(fd,2)=nameid; - WFIFOSET(fd,packet_len(0x10a)); + p.itemId = nameid; + memcpy(WFIFOP(fd, 0), &p, sizeof(p)); + WFIFOSET(fd, sizeof(p)); } /// MVP EXP reward message (ZC_MVP_GETTING_SPECIAL_EXP). diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5d4790552..ffa3d02d3 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1860,6 +1860,15 @@ struct PACKET_ZC_ADD_ITEM_TO_STORE { struct ItemOptions option_data[MAX_ITEM_OPTIONS]; } __attribute__((packed)); +struct PACKET_ZC_MVP_GETTING_ITEM { + int16 packetType; +#if PACKETVER_RE_NUM >= 20180704 + uint32 itemId; +#else + uint16 itemId; +#endif +} __attribute__((packed)); + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris |