summaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/cpp_api/s_item.cpp')
-rw-r--r--src/script/cpp_api/s_item.cpp3
1 files changed, 3 insertions, 0 deletions
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