summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRidley <ridley8819@gmail.com>2017-02-24 16:41:07 +0100
committerGitHub <noreply@github.com>2017-02-24 16:41:07 +0100
commit820070147a4f6ec464b99c227fae7929fa12c5e4 (patch)
tree1ff5f4e0284625ec3656a5aae8c1d82b3623602e /src
parent20145c61053479b9acd8ed50c75a80c2a861e349 (diff)
parentdaeb331d7dee30b9fa985665366527c2f09ef5a9 (diff)
downloadhercules-820070147a4f6ec464b99c227fae7929fa12c5e4.tar.gz
hercules-820070147a4f6ec464b99c227fae7929fa12c5e4.tar.bz2
hercules-820070147a4f6ec464b99c227fae7929fa12c5e4.tar.xz
hercules-820070147a4f6ec464b99c227fae7929fa12c5e4.zip
Merge pull request #1567 from guilherme-gm/fix-nameditem
Fixes named items having their names changed when near other players
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c12
-rw-r--r--src/map/packets_struct.h9
2 files changed, 19 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index c48241898..2791755a3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1077,9 +1077,11 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
-
clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
if (clif->isdisguised(bl)) {
@@ -1220,6 +1222,9 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
if (clif->isdisguised(bl)) {
@@ -1262,7 +1267,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20131223
p.AID = bl->id;
- p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE
+ p.GID = (sd) ? sd->status.char_id : 0; // CCODE
#else
p.GID = bl->id;
#endif
@@ -1312,6 +1317,9 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index e461eebe9..4d474ac93 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -589,6 +589,9 @@ struct packet_spawn_unit {
#endif
#if PACKETVER >= 20150513
int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
@@ -657,6 +660,9 @@ struct packet_unit_walking {
#endif
#if PACKETVER >= 20150513
int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
@@ -723,6 +729,9 @@ struct packet_idle_unit {
#endif
#if PACKETVER >= 20150513
int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));