mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-23 03:13:44 +01:00
Code cleaning
This commit is contained in:
parent
60d89f51e7
commit
0b7bfca0ec
17
init.lua
17
init.lua
@ -1438,19 +1438,14 @@ local function handle_drops_table(name, drop)
|
|||||||
if not dstack:is_empty() and dname ~= name then
|
if not dstack:is_empty() and dname ~= name then
|
||||||
local dcount = dstack:get_count()
|
local dcount = dstack:get_count()
|
||||||
|
|
||||||
if #di.items == 1 and (not di.rarity or
|
if #di.items == 1 and max_start and
|
||||||
di.rarity <= 1) and max_start then
|
(not di.rarity or di.rarity <= 1) then
|
||||||
-- TODO: add `tools`
|
|
||||||
if not drop_sure[dname] then
|
if not drop_sure[dname] then
|
||||||
drop_sure[dname] = {}
|
drop_sure[dname] = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
if not drop_sure[dname].output then
|
|
||||||
drop_sure[dname].output = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
drop_sure[dname] = {
|
drop_sure[dname] = {
|
||||||
output = drop_sure[dname].output + dcount,
|
output = (drop_sure[dname].output or 0) + dcount,
|
||||||
tools = di.tools,
|
tools = di.tools,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1467,12 +1462,8 @@ local function handle_drops_table(name, drop)
|
|||||||
drop_maybe[dname] = {}
|
drop_maybe[dname] = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
if not drop_maybe[dname].output then
|
|
||||||
drop_maybe[dname].output = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
drop_maybe[dname] = {
|
drop_maybe[dname] = {
|
||||||
output = drop_maybe[dname].output + dcount,
|
output = (drop_maybe[dname].output or 0) + dcount,
|
||||||
rarity = di.rarity,
|
rarity = di.rarity,
|
||||||
tools = di.tools,
|
tools = di.tools,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user