From 304f26bf681ac8c003c1979da4855426be60bb09 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 Jul 2018 00:46:35 +0300 Subject: Update packet ZC_FEED_PET. --- src/map/clif.c | 14 ++++++++------ src/map/packets_struct.h | 10 ++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index a666f4724..56be573c4 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7328,15 +7328,17 @@ static void clif_pet_emotion(struct pet_data *pd, int param) static void clif_pet_food(struct map_session_data *sd, int foodid, int fail) { int fd; + struct PACKET_ZC_FEED_PET p; nullpo_retv(sd); - fd=sd->fd; - WFIFOHEAD(fd,packet_len(0x1a3)); - WFIFOW(fd,0)=0x1a3; - WFIFOB(fd,2)=fail; - WFIFOW(fd,3)=foodid; - WFIFOSET(fd,packet_len(0x1a3)); + fd = sd->fd; + WFIFOHEAD(fd, sizeof(p)); + p.packetType = 0x1a3; + p.result = fail; + p.itemId = foodid; + memcpy(WFIFOP(fd, 0), &p, sizeof(p)); + WFIFOSET(fd, sizeof(p)); } /// Presents a list of skills that can be auto-spelled (ZC_AUTOSPELLLIST). diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 3c8ec9428..aa2f376e3 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1923,6 +1923,16 @@ struct PACKET_ZC_ACK_REQMAKINGITEM { #endif } __attribute__((packed)); +struct PACKET_ZC_FEED_PET { + int16 packetType; + uint8 result; +#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 -- cgit v1.2.3-70-g09d2