Skip to content

Commit

Permalink
refactor supply converter enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jul 21, 2020
1 parent b7a68f7 commit 6f83cb8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions technic/machines/supply_converter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,9 @@ local run = function(pos, node, run_stage)
-- Machine information
local machine_name = S("Supply Converter")
local meta = minetest.get_meta(pos)
local enabled = meta:get_string("enabled")
if enabled == "" then
-- Backwards compatibility
minetest.registered_nodes["technic:supply_converter"].on_construct(pos)
enabled = true
else
-- compatibility case for #71
enabled = meta:get_int("enabled") == 1
end
enabled = enabled and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)
local enabled = meta:get_int("enabled") == 1 and
(meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0)

local demand = enabled and meta:get_int("power") or 0

local pos_up = {x=pos.x, y=pos.y+1, z=pos.z}
Expand Down

0 comments on commit 6f83cb8

Please sign in to comment.