summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-06 00:52:53 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:16 +0300
commit540da98b7d2ce92623678281e963c52c8e1f797b (patch)
tree87396ed9e2e662f04a6d78f8eaeb1c0fe3a771c5 /src/map
parent304f26bf681ac8c003c1979da4855426be60bb09 (diff)
downloadhercules-540da98b7d2ce92623678281e963c52c8e1f797b.tar.gz
hercules-540da98b7d2ce92623678281e963c52c8e1f797b.tar.bz2
hercules-540da98b7d2ce92623678281e963c52c8e1f797b.tar.xz
hercules-540da98b7d2ce92623678281e963c52c8e1f797b.zip
Update packet ZC_FEED_MER.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c20
-rw-r--r--src/map/packets_struct.h10
2 files changed, 23 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 56be573c4..c00be574c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1799,19 +1799,25 @@ static void clif_homskillup(struct map_session_data *sd, uint16 skill_id)
WFIFOSET(fd,packet_len(0x239));
}
+/// Result of request to feed a homun/merc (ZC_FEED_MER).
+/// 022f <result>.B <name id>.W
+/// result:
+/// 0 = failure
+/// 1 = success
static void clif_hom_food(struct map_session_data *sd, int foodid, int fail)
{
int fd;
+ struct PACKET_ZC_FEED_MER p;
+
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd,packet_len(0x22f));
- WFIFOW(fd,0)=0x22f;
- WFIFOB(fd,2)=fail;
- WFIFOW(fd,3)=foodid;
- WFIFOSET(fd,packet_len(0x22f));
-
- return;
+ WFIFOHEAD(fd, sizeof(p));
+ p.packetType = 0x22f;
+ p.result = fail;
+ p.itemId = foodid;
+ memcpy(WFIFOP(fd, 0), &p, sizeof(p));
+ WFIFOSET(fd, sizeof(p));
}
/// Notifies the client, that it is walking (ZC_NOTIFY_PLAYERMOVE).
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index aa2f376e3..028cefa99 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -1933,6 +1933,16 @@ struct PACKET_ZC_FEED_PET {
#endif
} __attribute__((packed));
+struct PACKET_ZC_FEED_MER {
+ 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