summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-08-25 13:50:20 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-08-25 13:50:20 (EDT)
commitc1598e9441cb9e125616dbef5e090e1f32fcdfb2 (patch)
tree1f6b2cd9ae9caa7dc1f0287db393fbd9a5ce7dce /src
parentc0dde461aa23e95dacf6dbdb0a489e37c399fbf6 (diff)
downloadoverworld-rpg-c1598e9441cb9e125616dbef5e090e1f32fcdfb2.zip
overworld-rpg-c1598e9441cb9e125616dbef5e090e1f32fcdfb2.tar.gz
overworld-rpg-c1598e9441cb9e125616dbef5e090e1f32fcdfb2.tar.bz2
src/scripting/ffi.c: Fix stack index
Diffstat (limited to 'src')
-rw-r--r--src/scripting/ffi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scripting/ffi.c b/src/scripting/ffi.c
index a7e9834..785db37 100644
--- a/src/scripting/ffi.c
+++ b/src/scripting/ffi.c
@@ -116,7 +116,7 @@ ffi_register_functions_in_namespace(lua_State *l, struct ffi_namespace *parent)
if (parent == &root) {
lua_setglobal(l, ns->name);
} else {
- lua_setfield(l, -1, ns->name);
+ lua_setfield(l, -2, ns->name);
}
}
for (fn = parent->fn_head; fn != NULL; fn = fn->next) {