summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-08-17 18:57:04 +0300
committerAndrei Karas <akaras@inbox.ru>2019-08-21 22:36:42 +0300
commitc68e1ca5469c21f9b247db76915405692ed1d94c (patch)
treec89babbccff2343fe8f27b8bb4bf3fe0f3494ed3 /src
parent1a4e375c7490ed474c3be74b43b120f3aee07c16 (diff)
downloadhercules-c68e1ca5469c21f9b247db76915405692ed1d94c.tar.gz
hercules-c68e1ca5469c21f9b247db76915405692ed1d94c.tar.bz2
hercules-c68e1ca5469c21f9b247db76915405692ed1d94c.tar.xz
hercules-c68e1ca5469c21f9b247db76915405692ed1d94c.zip
Fix packet ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN
Thanks @Lemongrass3110
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 00b3e77ed..d1de3b4d0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -19967,7 +19967,11 @@ static void clif_package_item_announce(struct map_session_data *sd, int nameid,
nullpo_retv(sd);
p.PacketType = package_item_announceType;
- p.PacketLength = 11 + NAME_LENGTH;
+#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
+ p.PacketLength = 7 + 4 + 4 + NAME_LENGTH;
+#else
+ p.PacketLength = 7 + 2 + 2 + NAME_LENGTH;
+#endif
p.type = 0x0;
p.ItemID = nameid;
p.len = NAME_LENGTH;
@@ -19975,7 +19979,7 @@ static void clif_package_item_announce(struct map_session_data *sd, int nameid,
p.unknown = 0x2; // some strange byte, IDA shows.. BYTE3(BoxItemIDLength) = 2;
p.BoxItemID = containerid;
- clif->send(&p,sizeof(p), &sd->bl, ALL_CLIENT);
+ clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT);
}
/* Made Possible Thanks to Yommy! */
@@ -19993,12 +19997,13 @@ static void clif_item_drop_announce(struct map_session_data *sd, int nameid, cha
if (monsterName == NULL) {
// message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN2
p.type = 0x2;
+ p.PacketLength -= NAME_LENGTH;
} else {
// message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN
p.type = 0x1;
safestrncpy(p.monsterName, monsterName, sizeof(p.monsterName));
}
- clif->send(&p, sizeof(p), &sd->bl, ALL_CLIENT);
+ clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT);
}
/* [Ind/Hercules] special thanks to Yommy~! */