From d2c34c4b9b36d5f9ef7a327b62fc69efcd874f08 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 19 Aug 2013 20:05:03 -0700 Subject: Make some npc errors better --- src/map/script.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/map/script.cpp') 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(ZString(conv_str(st, &AARGO2(2))))); + NpcName name = stringish(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 nd = npc_name2id(name); if (!nd) + { + PRINTF("builtin_fakenpcname: no such npc: %s\n", name); return; + } nd->name = newname; nd->npc_class = newsprite; -- cgit v1.2.3-70-g09d2