From c98c736360fa4424f2a14cf26f18a3ca1fcaebcd Mon Sep 17 00:00:00 2001 From: Izaya Date: Sun, 12 Feb 2017 01:57:00 +0000 Subject: [PATCH] bugfixes and stuff --- test3d_t410/init.lua | 14 ++------------ test3d_t416/init.lua | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/test3d_t410/init.lua b/test3d_t410/init.lua index e15d77d..7d6f874 100644 --- a/test3d_t410/init.lua +++ b/test3d_t410/init.lua @@ -1,4 +1,3 @@ -local MEMSIZE=16 if not digiline then print("Digilines not found.") return @@ -12,16 +11,7 @@ end print("Loading.") local function t410_set_meta(pos) - local meta = minetest.get_meta(pos) - local ms = "" - for i = 1, MEMSIZE do - ms = ms .. "0\n" - end - meta:set_string("mem",ms) - meta:set_string("channel","Default") - meta:set_int("startaddr",0) - meta:set_string("formspec","size[2,4]\nfield[0,1;2.9,1;addr;Address;]\nfield[0,2;2.9,1;data;Data;]\nbutton[0,3;2,1;write;Write]") --- + minetest.get_meta(pos):set_string("formspec","size[2,4]\nfield[0,1;2.9,1;addr;Address;]\nfield[0,2;2.9,1;data;Data;]\nbutton[0,3;2,1;write;Write]") end minetest.register_node("test3d_t410:t410", { description = "T410 Memory Access Console", @@ -30,7 +20,7 @@ minetest.register_node("test3d_t410:t410", { groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, on_receive_fields = function(pos,_,fields,sender) if fields.addr == nil then return end - digiline:receptor_send(pos, digiline.rules.default, fields.addr, tonumber(fields.data or 0)) + digiline:receptor_send(pos, digiline.rules.default, fields.addr, tonumber(fields.data) or 0) print("Set "..fields.addr.." to "..fields.data) end, digiline = { diff --git a/test3d_t416/init.lua b/test3d_t416/init.lua index b84d9f7..601e51a 100644 --- a/test3d_t416/init.lua +++ b/test3d_t416/init.lua @@ -54,7 +54,7 @@ minetest.register_node("test3d_t416:t416", { digiline = { receptor = {}, effector = { - action = t416_digiline_receive + action = function (a,b,c,d) pcall(t416_digiline_receive,a,b,c,d) end } }, on_receive_fields = function(pos,_,fields,sender)