Remove redundant logic.

The function on_place_bucket contains the following logic:
  if not a and not b then return x end
  if a then
    foo(a)
  elseif b then
    foo(b)
  else
    return x
  end

The "if not a and not b then .." is removed because the case is handled
by the else case later on.  This will allow some further simplifications.
This commit is contained in:
kabou 2022-02-20 18:15:56 +01:00
parent b3aed9d6b8
commit 88ce1e3662
1 changed files with 0 additions and 2 deletions

View File

@ -170,8 +170,6 @@ local function on_place_bucket(itemstack, user, pointed_thing, def)
local buildable1 = regnode1 and (regnode1.buildable_to or get_item_group(name1, "cauldron") == 1)
local buildable2 = regnode2 and (regnode2.buildable_to or get_item_group(name2, "cauldron") == 1)
if not buildable1 and not buildable2 then return itemstack end --if both nodes aren't buildable_to, skip
if buildable1 then
local result, take_bucket = get_extra_check(def.extra_check, pointed_thing.under, user)
if result then