]> git.sesse.net Git - nageru/commitdiff
Fix theme menu check state.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 24 Jul 2023 12:00:17 +0000 (14:00 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 24 Jul 2023 12:00:17 +0000 (14:00 +0200)
We'd always (wrongly) get the value from the last entry in the list.

Reported by Stefano Rivera.

nageru/theme.cpp

index 937043f7ca72e96ad60bf7a4611857091bf13730..19c90d4783c9a695f1175cb6268740973d3d730f 100644 (file)
@@ -2074,8 +2074,8 @@ unique_ptr<Theme::MenuEntry> create_theme_menu_entry(lua_State *L, int index)
        lua_pop(L, 1);
 
        unsigned flags = 0;
-       if (lua_objlen(L, -1) > 2) {
-               lua_rawgeti(L, -1, 3);
+       if (lua_objlen(L, index) > 2) {
+               lua_rawgeti(L, index, 3);
                flags = luaL_checknumber(L, -1);
                lua_pop(L, 1);
        }