Improve overheating (#334)

New overheating system that doesn’t use the meta.
This commit is contained in:
numberZero
2017-04-14 23:14:17 +04:00
committed by GitHub
parent 2554164674
commit 54b9eaffa2
4 changed files with 55 additions and 20 deletions

View File

@ -315,7 +315,7 @@ local function create_environment(pos, mem, event)
port = vports_copy,
event = event,
mem = mem,
heat = minetest.get_meta(pos):get_int("heat"),
heat = mesecon.get_heat(pos),
heat_max = mesecon.setting("overheat_max", 20),
print = safe_print,
interrupt = get_interrupt(pos),
@ -485,7 +485,6 @@ local function reset_meta(pos, code, errmsg)
"image_button[3.75,6;2.5,1;jeija_luac_runbutton.png;program;]"..
"image_button_exit[9.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]"..
"label[0.1,5;"..errmsg.."]")
meta:set_int("heat", 0)
meta:set_int("luac_id", math.random(1, 65535))
end
@ -626,6 +625,7 @@ for d = 0, 1 do
d = d == 1,
},
after_dig_node = function (pos, node)
mesecon.do_cooldown(pos)
mesecon.receptor_off(pos, output_rules)
end,
is_luacontroller = true,