summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAngelmelody <cutepeipei@hotmail.com.tw>2016-04-03 03:12:53 +0800
committerHaru <haru@dotalux.com>2016-04-02 21:12:53 +0200
commitadf02727830b0877d2d506e0f67f6d3a60730e40 (patch)
treee83645e084e4e8cbe9e41facefc62c599c1c4455 /src/map/script.c
parent88edba8f6db78611f3c70bcd52b7d77ba19e2136 (diff)
downloadhercules-adf02727830b0877d2d506e0f67f6d3a60730e40.tar.gz
hercules-adf02727830b0877d2d506e0f67f6d3a60730e40.tar.bz2
hercules-adf02727830b0877d2d506e0f67f6d3a60730e40.tar.xz
hercules-adf02727830b0877d2d506e0f67f6d3a60730e40.zip
Unittalk script cmd shouldn't display the hidden name of npc
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index fd653523d..7ad9fd141 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16818,8 +16818,12 @@ BUILDIN(unittalk) {
bl = map->id2bl(unit_id);
if( bl != NULL ) {
struct StringBuf sbuf;
+ char blname[NAME_LENGTH];
StrBuf->Init(&sbuf);
- StrBuf->Printf(&sbuf, "%s : %s", clif->get_bl_name(bl), message);
+ safestrncpy(blname, clif->get_bl_name(bl), sizeof(blname));
+ if(bl->type == BL_NPC)
+ strtok(blname, "#");
+ StrBuf->Printf(&sbuf, "%s : %s", blname, message);
clif->disp_overhead(bl, StrBuf->Value(&sbuf));
StrBuf->Destroy(&sbuf);
}