mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-22 19:03:43 +01:00
Fix some glitch
This commit is contained in:
parent
0956e86d73
commit
40b5f8725a
15
init.lua
15
init.lua
@ -70,23 +70,23 @@ local function table_merge(t, t2)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function table_diff(t, t2)
|
local function table_diff(t, t2)
|
||||||
local t3 = {}
|
local hash = {}
|
||||||
|
|
||||||
for i = 1, #t do
|
for i = 1, #t do
|
||||||
local v = t[i]
|
local v = t[i]
|
||||||
t3[v] = true
|
hash[v] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1, #t2 do
|
for i = 1, #t2 do
|
||||||
local v = t2[i]
|
local v = t2[i]
|
||||||
t3[v] = nil
|
hash[v] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local ret, c = {}, 0
|
local ret, c = {}, 0
|
||||||
|
|
||||||
for i = 1, #t do
|
for i = 1, #t do
|
||||||
local v = t[i]
|
local v = t[i]
|
||||||
if t3[v] then
|
if hash[v] then
|
||||||
c = c + 1
|
c = c + 1
|
||||||
ret[c] = v
|
ret[c] = v
|
||||||
end
|
end
|
||||||
@ -730,8 +730,13 @@ local function on_receive_fields(player, fields)
|
|||||||
data.show_usages = not data.show_usages
|
data.show_usages = not data.show_usages
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local recipes = get_recipes(item, data, player)
|
||||||
|
if not recipes then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
data.query_item = item
|
data.query_item = item
|
||||||
data.recipes = get_recipes(item, data, player)
|
data.recipes = recipes
|
||||||
data.rnum = 1
|
data.rnum = 1
|
||||||
|
|
||||||
show_fs(player, name)
|
show_fs(player, name)
|
||||||
|
Loading…
Reference in New Issue
Block a user