From 260c83087ce1ebac01fb418932220fcd1936e3d7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 2 Jun 2017 23:14:19 +0200 Subject: [PATCH] Creative inv.: Reset scroll bar when switching --- mods/HUD/mcl_inventory/creative.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 76204b209..39c275fbd 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -446,9 +446,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.creative_prev then start_i = start_i - 9*5 - end - if fields.creative_next then + elseif fields.creative_next then start_i = start_i + 9*5 + else + -- Reset scroll bar if not scrolled + start_i = 0 end if start_i < 0 then start_i = start_i + 9*5