summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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