diff options
author | Asheraf <acheraf1998@gmail.com> | 2018-05-26 23:42:02 +0000 |
---|---|---|
committer | Asheraf <acheraf1998@gmail.com> | 2018-06-30 00:43:06 +0100 |
commit | dff7e258eb1e4eefc5d455212a912fe454b7d3d3 (patch) | |
tree | 23b057fee0bb2b53bc688f7adefa91ef35a297cc /src/map/clif.c | |
parent | 8ea98a7ff92e0f34f323342b1d69da42d92f39ae (diff) | |
download | hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.tar.gz hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.tar.bz2 hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.tar.xz hercules-dff7e258eb1e4eefc5d455212a912fe454b7d3d3.zip |
add support for send target in unittalk
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 654c43b53..18fb063ef 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8965,7 +8965,7 @@ void clif_slide(struct block_list *bl, int x, int y) /// Public chat message (ZC_NOTIFY_CHAT). lordalfa/Skotlex - used by @me as well /// 008d <packet len>.W <id>.L <message>.?B -void clif_disp_overhead(struct block_list *bl, const char *mes) +void clif_disp_overhead(struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl) { char buf[CHAT_SIZE_MAX + (int)sizeof(struct PACKET_ZC_NOTIFY_CHAT)]; uint32 max_len = CHAT_SIZE_MAX - (int)sizeof(struct PACKET_ZC_NOTIFY_CHAT); @@ -8986,11 +8986,15 @@ void clif_disp_overhead(struct block_list *bl, const char *mes) p->PacketLength = mes_len + (int)sizeof(struct PACKET_ZC_NOTIFY_CHAT); // len of message + 8 (command+len+id) p->GID = bl->id; safestrncpy(p->Message, mes, mes_len); - clif->send(p, p->PacketLength, bl, AREA_CHAT_WOC); + if (target == SELF && target_bl != NULL) { + clif->send(p, p->PacketLength, target_bl, SELF); + } else { + clif->send(p, p->PacketLength, bl, AREA_CHAT_WOC); - // send back message to the speaker - if (bl->type == BL_PC) - clif->notify_playerchat(bl, mes); + // send back message to the speaker + if (bl->type == BL_PC) + clif->notify_playerchat(bl, mes); + } } void clif_notify_playerchat(struct block_list *bl, const char *mes) |