summaryrefslogtreecommitdiff
path: root/src/map/script-fun.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-12 14:18:48 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-12 14:18:48 -0400
commitd17edc2fb98f6c2e177a6252bade155ee88f5979 (patch)
treed46439272677c2ea3ae9a980e364d4851ca19074 /src/map/script-fun.cpp
parentf9df1a84b4486eefc65fb91287c2c399531e5b37 (diff)
downloadtmwa-d17edc2fb98f6c2e177a6252bade155ee88f5979.tar.gz
tmwa-d17edc2fb98f6c2e177a6252bade155ee88f5979.tar.bz2
tmwa-d17edc2fb98f6c2e177a6252bade155ee88f5979.tar.xz
tmwa-d17edc2fb98f6c2e177a6252bade155ee88f5979.zip
allow to use npctalk on non-script npcs
Diffstat (limited to 'src/map/script-fun.cpp')
-rw-r--r--src/map/script-fun.cpp6
1 files changed, 3 insertions, 3 deletions
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)){