Skip to content
Permalink
Browse files

Creative: Reset 'start_i' to 1 when the inventory filter is changed

  • Loading branch information
red-001 authored and paramat committed May 19, 2016
1 parent 90f24e3 commit b1e0864cf195d65142ef361fc287c09eaa8f2667
Showing with 3 additions and 0 deletions.
  1. +3 −0 mods/creative/init.lua
@@ -178,6 +178,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif fields.creative_tabs then
local tab = tonumber(fields.creative_tabs)
inv.tab_id = tab
player_inventory[player_name].start_i = 1

if tab == 1 then
creative.set_crafting_formspec(player)
@@ -186,10 +187,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
creative.set_creative_formspec(player, 0)
end
elseif fields.creative_clear then
player_inventory[player_name].start_i = 1
inv.filter = ""
creative.update_creative_inventory(player_name)
creative.set_creative_formspec(player, 0)
elseif fields.creative_search then
player_inventory[player_name].start_i = 1
inv.filter = fields.creative_filter:lower()
creative.update_creative_inventory(player_name)
creative.set_creative_formspec(player, 0)

0 comments on commit b1e0864

Please sign in to comment.
You can’t perform that action at this time.