summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/battle.cpp7
-rw-r--r--src/map/clif.cpp3
-rw-r--r--src/map/script-fun.cpp6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 031b79d..df01a5c 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -197,7 +197,12 @@ VString<23> battle_get_name(dumb_ptr<block_list> bl)
name = bl->is_player()->status_key.name.to__actual();
break;
case BL::NPC:
- name = bl->is_npc()->name;
+ {
+ name = bl->is_npc()->name;
+ // [fate] elim hashed out/invisible names for the client
+ auto it = std::find(name.begin(), name.end(), '#');
+ name = name.xislice_h(it);
+ }
break;
case BL::MOB:
name = bl->is_mob()->name;
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index d4b16a7..94a6dd1 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -3809,7 +3809,8 @@ static
void clif_message_sub(Buffer& buf, dumb_ptr<block_list> bl, AString msg)
{
VString<23> name = battle_get_name(bl);
- msg = STRPRINTF("%s : %s"_fmt, name, msg);
+ if (name.size() >= 4) // client limitation
+ msg = STRPRINTF("%s : %s"_fmt, name, msg);
size_t msg_len = msg.size() + 1;
if (msg_len + 16 > 512)
return;
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 98c07ed..8ec0d4a 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -4252,9 +4252,9 @@ void builtin_npctalk(ScriptState *st)
dumb_ptr<npc_data> nd;
RString str = conv_str(st, &AARG(1));
- dumb_ptr<npc_data> nd_ = npc_name2id(stringish<NpcName>(ZString(conv_str(st, &AARG(0)))));
- assert (nd_ && nd_->npc_subtype == NpcSubtype::SCRIPT);
- nd = nd_->is_script();
+ nd = npc_name2id(stringish<NpcName>(ZString(conv_str(st, &AARG(0)))));
+ if (nd == nullptr)
+ return;
if(HARG(2)){