From c2a722b629b08a2eae726ad4b663616c8d0c4231 Mon Sep 17 00:00:00 2001
From: Daniel Foerster <pydsigner@gmail.com>
Date: Thu, 12 Nov 2015 23:02:23 -0600
Subject: Add NPC location information to run_func

---
 src/map/script-call.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/map')

diff --git a/src/map/script-call.cpp b/src/map/script-call.cpp
index 83b6f24..0c67ba8 100644
--- a/src/map/script-call.cpp
+++ b/src/map/script-call.cpp
@@ -596,7 +596,12 @@ void run_func(ScriptState *st)
 
     if (!st->stack->stack_datav[st->start].is<ScriptDataFuncRef>())
     {
-        PRINTF("run_func: not function and command! \n"_fmt);
+        dumb_ptr<npc_data> nd = map_id_is_npc(st->oid);
+        if(nd)
+            PRINTF("run_func: not a function or statement! @ %s\n"_fmt, nd->name);
+        else
+            PRINTF("run_func: not a function or statement! (no npc)\n"_fmt);
+
         st->state = ScriptEndState::END;
         abort();
     }
-- 
cgit v1.2.3-70-g09d2