From cf28f0002c46e9c23e752b7e4b351de1e947f830 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Apr 2019 22:27:37 +0300 Subject: Add into unit_data groupId and title Send this fields in packet ZC_ACK_REQNAME_TITLE. --- src/map/clif.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/map/unit.h | 2 ++ 2 files changed, 44 insertions(+) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index 1fa9c4093..83d256e51 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9327,6 +9327,13 @@ static void clif_homname_ack(int fd, struct block_list *bl) packet.packet_id = HEADER_ZC_ACK_REQNAME_TITLE; packet.gid = bl->id; memcpy(packet.name, BL_UCCAST(BL_HOM, bl)->homunculus.name, NAME_LENGTH); +#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 + struct unit_data *ud = unit->bl2ud(bl); + if (ud != NULL) { + memcpy(packet.title, ud->title, NAME_LENGTH); + packet.groupId = ud->groupId; + } +#endif clif->send_selforarea(fd, bl, &packet, sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE)); } @@ -9344,6 +9351,13 @@ static void clif_mername_ack(int fd, struct block_list *bl) packet.packet_id = HEADER_ZC_ACK_REQNAME_TITLE; packet.gid = bl->id; memcpy(packet.name, BL_UCCAST(BL_MER, bl)->db->name, NAME_LENGTH); +#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 + struct unit_data *ud = unit->bl2ud(bl); + if (ud != NULL) { + memcpy(packet.title, ud->title, NAME_LENGTH); + packet.groupId = ud->groupId; + } +#endif clif->send_selforarea(fd, bl, &packet, sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE)); } @@ -9361,6 +9375,13 @@ static void clif_petname_ack(int fd, struct block_list *bl) packet.packet_id = HEADER_ZC_ACK_REQNAME_TITLE; packet.gid = bl->id; memcpy(packet.name, BL_UCCAST(BL_PET, bl)->pet.name, NAME_LENGTH); +#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 + struct unit_data *ud = unit->bl2ud(bl); + if (ud != NULL) { + memcpy(packet.title, ud->title, NAME_LENGTH); + packet.groupId = ud->groupId; + } +#endif clif->send_selforarea(fd, bl, &packet, sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE)); } @@ -9378,6 +9399,13 @@ static void clif_npcname_ack(int fd, struct block_list *bl) packet.packet_id = HEADER_ZC_ACK_REQNAME_TITLE; packet.gid = bl->id; memcpy(packet.name, BL_UCCAST(BL_NPC, bl)->name, NAME_LENGTH); +#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 + struct unit_data *ud = unit->bl2ud(bl); + if (ud != NULL) { + memcpy(packet.title, ud->title, NAME_LENGTH); + packet.groupId = ud->groupId; + } +#endif clif->send_selforarea(fd, bl, &packet, sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE)); } @@ -9436,6 +9464,13 @@ static void clif_chatname_ack(int fd, struct block_list *bl) #if 0 //FIXME: Clients DO request this... what should be done about it? The chat's title may not fit... [Skotlex] memcpy(packet.name, BL_UCCAST(BL_CHAT, bl)->title, NAME_LENGTH); +#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 + struct unit_data *ud = unit->bl2ud(bl); + if (ud != NULL) { + memcpy(packet.title, ud->title, NAME_LENGTH); + packet.groupId = ud->groupId; + } +#endif #endif clif->send_selforarea(fd, bl, &packet, sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE)); @@ -9454,6 +9489,13 @@ static void clif_elemname_ack(int fd, struct block_list *bl) packet.packet_id = HEADER_ZC_ACK_REQNAME_TITLE; packet.gid = bl->id; memcpy(packet.name, BL_UCCAST(BL_ELEM, bl)->db->name, NAME_LENGTH); +#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130 + struct unit_data *ud = unit->bl2ud(bl); + if (ud != NULL) { + memcpy(packet.title, ud->title, NAME_LENGTH); + packet.groupId = ud->groupId; + } +#endif clif->send_selforarea(fd, bl, &packet, sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE)); } diff --git a/src/map/unit.h b/src/map/unit.h index 5c01cdc2e..3209351e3 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -44,6 +44,7 @@ enum unit_stopwalking_flag { struct unit_data { struct block_list *bl; + char title[NAME_LENGTH]; struct walkpath_data walkpath; struct skill_timerskill *skilltimerskill[MAX_SKILLTIMERSKILL]; struct skill_unit_group *skillunit[MAX_SKILLUNITGROUP]; @@ -61,6 +62,7 @@ struct unit_data { int chaserange; bool stepaction; //Action should be executed on step [Playtester] int steptimer; //Timer that triggers the action [Playtester] + int groupId; // id of client side group (works for npc and may be other) [4144] uint16 stepskill_id,stepskill_lv; //Remembers skill that should be casted on step [Playtester] int64 attackabletime; int64 canact_tick; -- cgit v1.2.3-60-g2f50