From 2b04ab874d75711bc021a0cd8dc7fca68f4e6929 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 11 Aug 2015 22:27:54 -0400 Subject: SAPI: Track last executed mod and include in error messages --- src/script/cpp_api/s_item.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/script/cpp_api/s_item.cpp') diff --git a/src/script/cpp_api/s_item.cpp b/src/script/cpp_api/s_item.cpp index 1ca06de76..4d4d416ec 100644 --- a/src/script/cpp_api/s_item.cpp +++ b/src/script/cpp_api/s_item.cpp @@ -193,6 +193,9 @@ bool ScriptApiItem::getItemCallback(const char *name, const char *callbackname) lua_remove(L, -2); luaL_checktype(L, -1, LUA_TTABLE); } + + setOriginFromTable(-1); + lua_getfield(L, -1, callbackname); lua_remove(L, -2); // Remove item def // Should be a function or nil -- cgit v1.2.3