Add files via upload

master
AiTechEye 2019-01-20 22:32:24 +01:00 committed by GitHub
parent d5cd7e8a03
commit a1498e3bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View File

@ -34,7 +34,6 @@ minetest.register_craft({
} }
}) })
--[[ currently broken
minetest.register_craft({ minetest.register_craft({
output = "was:router", output = "was:router",
recipe = { recipe = {
@ -43,7 +42,6 @@ minetest.register_craft({
{"was:plastic_piece","was:wire","was:plastic_piece"}, {"was:plastic_piece","was:wire","was:plastic_piece"},
} }
}) })
--]]
minetest.register_craft({ minetest.register_craft({
output = "was:sender", output = "was:sender",

View File

@ -56,8 +56,13 @@ end
was.send_wireless=function(pos,channel,msg,from_channel,radius) was.send_wireless=function(pos,channel,msg,from_channel,radius)
for _,p in pairs(minetest.find_nodes_in_area(vector.add(pos,radius),vector.subtract(pos,radius),"group:was_unit")) do for _,p in pairs(minetest.find_nodes_in_area(vector.add(pos,radius),vector.subtract(pos,radius),"group:was_unit")) do
if minetest.get_item_group(was.get_node(p),"was_resender")==0 and not vector.equals(pos,p) then local na=was.get_node(p)
was.send(p,channel,msg,from_channel) if minetest.get_item_group(na,"was_resender")==0 and not vector.equals(pos,p) then
if minetest.registered_nodes[na].on_waswire then
minetest.registered_nodes[na].on_waswire(p,channel,from_channel,msg)
else
was.send(p,channel,msg,from_channel)
end
end end
end end
end end

View File

@ -307,6 +307,7 @@ minetest.register_node("was:router", {
was.send(p,channel,msg,from_channel) was.send(p,channel,msg,from_channel)
end end
end end
was.send(pos,channel,msg,from_channel)
end, end,
on_timer = function (pos, elapsed) on_timer = function (pos, elapsed)
minetest.swap_node(pos,{name="was:wire",param2=135}) minetest.swap_node(pos,{name="was:wire",param2=135})

View File

@ -864,10 +864,6 @@ was.register_function("was.close",{
end end
}) })
--[[
currently broken
was.register_function("was.send_wireless",{ was.register_function("was.send_wireless",{
info="Send data through wires (string_channel msg radius) max radius is 10", info="Send data through wires (string_channel msg radius) max radius is 10",
action=function(channel,msg,radius) action=function(channel,msg,radius)
@ -880,10 +876,8 @@ was.register_function("was.send_wireless",{
if nchannel==channel then if nchannel==channel then
was.userdata.error="can't send to same channel" was.userdata.error="can't send to same channel"
else else
was.send(p,channel,msg,nchannel)
was.send_wireless(p,channel,msg,nchannel,radius) was.send_wireless(p,channel,msg,nchannel,radius)
end end
end end
end end
}) })
--]]