From 0b7bfca0ecc6d98d9d7cf6e43ffa62a03a6fbe28 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Fri, 3 Jul 2020 19:17:24 +0200 Subject: [PATCH] Code cleaning --- init.lua | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index 45e7302..1252712 100644 --- a/init.lua +++ b/init.lua @@ -1438,19 +1438,14 @@ local function handle_drops_table(name, drop) if not dstack:is_empty() and dname ~= name then local dcount = dstack:get_count() - if #di.items == 1 and (not di.rarity or - di.rarity <= 1) and max_start then - -- TODO: add `tools` + if #di.items == 1 and max_start and + (not di.rarity or di.rarity <= 1) then if not drop_sure[dname] then drop_sure[dname] = {} end - if not drop_sure[dname].output then - drop_sure[dname].output = 0 - end - drop_sure[dname] = { - output = drop_sure[dname].output + dcount, + output = (drop_sure[dname].output or 0) + dcount, tools = di.tools, } @@ -1467,12 +1462,8 @@ local function handle_drops_table(name, drop) drop_maybe[dname] = {} end - if not drop_maybe[dname].output then - drop_maybe[dname].output = 0 - end - drop_maybe[dname] = { - output = drop_maybe[dname].output + dcount, + output = (drop_maybe[dname].output or 0) + dcount, rarity = di.rarity, tools = di.tools, }