diff options
| author | ame <[email protected]> | 2025-09-03 18:24:03 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2025-09-03 18:24:03 -0500 |
| commit | 88a12e1ed5f15cc7039c9ad94cfb78f33d31bee9 (patch) | |
| tree | f58a93d5a3c5983e83531221c00d157fab88aeab /src/lua.c | |
| parent | 1aba3757b486e28ddfb0aff67fe65e4a7a87c74f (diff) | |
merge fixes
Diffstat (limited to 'src/lua.c')
| -rw-r--r-- | src/lua.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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)
|
