summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-06 00:46:35 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:16 +0300
commit304f26bf681ac8c003c1979da4855426be60bb09 (patch)
tree21aa0f5314a40a41b2b26131228c7eb72b460146
parent3a970959f9e0a2589c98355a0ff7afbbde5bf212 (diff)
downloadhercules-304f26bf681ac8c003c1979da4855426be60bb09.tar.gz
hercules-304f26bf681ac8c003c1979da4855426be60bb09.tar.bz2
hercules-304f26bf681ac8c003c1979da4855426be60bb09.tar.xz
hercules-304f26bf681ac8c003c1979da4855426be60bb09.zip
Update packet ZC_FEED_PET.
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/packets_struct.h10
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