forked from LizzyFleckenstein03/Memeclone
Fix crash when trying to craft banner in 2×2 grid
This commit is contained in:
parent
2d38852f90
commit
ea7c1e6446
|
@ -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
|
-- This complex code just iterates through the pattern slots one-by-one and compares them with the pattern
|
||||||
for p=1, #pattern do
|
for p=1, #pattern do
|
||||||
local row = pattern[p]
|
local row = pattern[p]
|
||||||
if inv_i > max_i then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
for r=1, #row do
|
for r=1, #row do
|
||||||
local itemname = old_craft_grid[inv_i]:get_name()
|
local itemname = old_craft_grid[inv_i]:get_name()
|
||||||
local pitem = row[r]
|
local pitem = row[r]
|
||||||
|
@ -407,6 +404,12 @@ local banner_pattern_craft = function(itemstack, player, old_craft_grid, craft_i
|
||||||
else
|
else
|
||||||
end
|
end
|
||||||
inv_i = inv_i + 1
|
inv_i = inv_i + 1
|
||||||
|
if inv_i > max_i then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if inv_i > max_i then
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Everything matched! We found our pattern!
|
-- Everything matched! We found our pattern!
|
||||||
|
|
Loading…
Reference in New Issue