diff options
author | number Zero <silverunicorn2011@yandex.ru> | 2017-03-17 21:10:43 +0300 |
---|---|---|
committer | number Zero <silverunicorn2011@yandex.ru> | 2017-03-17 21:10:43 +0300 |
commit | 408128d800c4e5cd62fa3e81537d0a9751b85997 (patch) | |
tree | ec79acff011fe469ef035ae208a4f43b5c16fa87 | |
parent | 2a7dbe0506f311db8263aa424bc51a4f8810f68d (diff) |
Add backward compatibility to the new supply converter
-rw-r--r-- | technic/machines/supply_converter.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index 0d32439..af10baa 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -68,7 +68,15 @@ 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") ~= "0" and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0) + local enabled = meta:get_string("enabled") + if enabled == "" then + -- Backwards compatibility + minetest.registered_nodes["technic:supply_converter"].on_construct(pos) + enabled = true + else + enabled = enabled == "1" + end + enabled = enabled 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} |