aboutsummaryrefslogtreecommitdiff
path: root/src/lua.c
diff options
context:
space:
mode:
authorame <[email protected]>2025-09-03 18:24:03 -0500
committerame <[email protected]>2025-09-03 18:24:03 -0500
commit88a12e1ed5f15cc7039c9ad94cfb78f33d31bee9 (patch)
treef58a93d5a3c5983e83531221c00d157fab88aeab /src/lua.c
parent1aba3757b486e28ddfb0aff67fe65e4a7a87c74f (diff)
merge fixes
Diffstat (limited to 'src/lua.c')
-rw-r--r--src/lua.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lua.c b/src/lua.c
index eedda0e..2623e29 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -375,21 +375,19 @@ int env_table(lua_State* L, int provide_table){
return 1;
}
-//main is the default values, merge is the new and overridden ones
-void luaI_jointable(lua_State* L, int main, int merge){
- int idx = lua_gettop(L);
-
- lua_pushvalue(L, merge);
+//top table is prioritized
+void luaI_jointable(lua_State* L){
+ int idx = lua_gettop(L) - 1;
lua_pushnil(L);
for(;lua_next(L, -2) != 0;){
lua_pushvalue(L, -2);
lua_pushvalue(L, -2);
- lua_settable(L, main);
+ lua_settable(L, idx);
lua_pop(L, 1);
}
- lua_settop(L, idx);
+ lua_pushvalue(L, idx);
}
//copys all variables from state A to B, including locals (stored in _locals)