mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-05 09:40:22 +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
|
||||
|
||||
local function table_diff(t, t2)
|
||||
local t3 = {}
|
||||
local hash = {}
|
||||
|
||||
for i = 1, #t do
|
||||
local v = t[i]
|
||||
t3[v] = true
|
||||
hash[v] = true
|
||||
end
|
||||
|
||||
for i = 1, #t2 do
|
||||
local v = t2[i]
|
||||
t3[v] = nil
|
||||
hash[v] = nil
|
||||
end
|
||||
|
||||
local ret, c = {}, 0
|
||||
|
||||
for i = 1, #t do
|
||||
local v = t[i]
|
||||
if t3[v] then
|
||||
if hash[v] then
|
||||
c = c + 1
|
||||
ret[c] = v
|
||||
end
|
||||
|
@ -730,8 +730,13 @@ local function on_receive_fields(player, fields)
|
|||
data.show_usages = not data.show_usages
|
||||
end
|
||||
|
||||
local recipes = get_recipes(item, data, player)
|
||||
if not recipes then
|
||||
return
|
||||
end
|
||||
|
||||
data.query_item = item
|
||||
data.recipes = get_recipes(item, data, player)
|
||||
data.recipes = recipes
|
||||
data.rnum = 1
|
||||
|
||||
show_fs(player, name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user