sfinv: Fix wrong tab being highlighted
authorrubenwardy <rubenwardy@gmail.com>
Sun, 5 Mar 2017 12:37:05 +0000 (12:37 +0000)
committerparamat <mat.gregory@virginmedia.com>
Tue, 7 Mar 2017 06:43:18 +0000 (06:43 +0000)
Thank you to @ForbiddenJ for finding cause of the issue.

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