sfinv: Fix wrong tab being highlighted
[oweals/minetest_game.git] / mods / sfinv / api.lua
index b6e976677cb3eca5e4c5514694d60d0aee63bc4a..ff6433b9bdc2a05b28f2a68108c1802ecb3296a4 100644 (file)
@@ -70,7 +70,7 @@ function sfinv.get_formspec(player, context)
                        nav[#nav + 1] = pdef.title
                        nav_ids[#nav_ids + 1] = pdef.name
                        if pdef.name == context.page then
-                               current_idx = i
+                               current_idx = #nav_ids
                        end
                end
        end