summaryrefslogtreecommitdiff
path: root/src/map/script.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-08-19 20:05:03 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-08-19 20:05:03 -0700
commitd2c34c4b9b36d5f9ef7a327b62fc69efcd874f08 (patch)
treeda028d8efb6285b6f948c29e29741e1fce8bf56e /src/map/script.cpp
parent5f198c32a3a700a5906dbcdcf7fb99c95a01727c (diff)
downloadtmwa-d2c34c4b9b36d5f9ef7a327b62fc69efcd874f08.tar.gz
tmwa-d2c34c4b9b36d5f9ef7a327b62fc69efcd874f08.tar.bz2
tmwa-d2c34c4b9b36d5f9ef7a327b62fc69efcd874f08.tar.xz
tmwa-d2c34c4b9b36d5f9ef7a327b62fc69efcd874f08.zip
Make some npc errors better
Diffstat (limited to 'src/map/script.cpp')
-rw-r--r--src/map/script.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp
index e82c843..56524d6 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -3869,7 +3869,10 @@ void builtin_npcwarp(ScriptState *st)
nd = npc_name2id(npc);
if (!nd)
+ {
+ PRINTF("builtin_npcwarp: no such npc: %s\n", npc);
return;
+ }
map_local *m = nd->bl_m;
@@ -4076,9 +4079,13 @@ void builtin_shop(ScriptState *st)
if (!sd)
return;
- nd = npc_name2id(stringish<NpcName>(ZString(conv_str(st, &AARGO2(2)))));
+ NpcName name = stringish<NpcName>(ZString(conv_str(st, &AARGO2(2))));
+ nd = npc_name2id(name);
if (!nd)
+ {
+ PRINTF("builtin_shop: no such npc: %s\n", name);
return;
+ }
builtin_close(st);
clif_npcbuysell(sd, nd->bl_id);
@@ -4108,7 +4115,10 @@ void builtin_fakenpcname(ScriptState *st)
int newsprite = conv_num(st, &AARGO2(4));
dumb_ptr<npc_data> nd = npc_name2id(name);
if (!nd)
+ {
+ PRINTF("builtin_fakenpcname: no such npc: %s\n", name);
return;
+ }
nd->name = newname;
nd->npc_class = newsprite;