Fix crash when trying to craft banner in 2×2 grid

This commit is contained in:
Wuzzy 2017-07-29 15:18:18 +02:00
parent 2d38852f90
commit ea7c1e6446

View file

@ -395,9 +395,6 @@ local banner_pattern_craft = function(itemstack, player, old_craft_grid, craft_i
-- This complex code just iterates through the pattern slots one-by-one and compares them with the pattern
for p=1, #pattern do
local row = pattern[p]
if inv_i > max_i then
break
end
for r=1, #row do
local itemname = old_craft_grid[inv_i]:get_name()
local pitem = row[r]
@ -407,6 +404,12 @@ local banner_pattern_craft = function(itemstack, player, old_craft_grid, craft_i
else
end
inv_i = inv_i + 1
if inv_i > max_i then
break
end
end
if inv_i > max_i then
break
end
end
-- Everything matched! We found our pattern!