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({
output = "was:router",
recipe = {
@ -43,7 +42,6 @@ minetest.register_craft({
{"was:plastic_piece","was:wire","was:plastic_piece"},
}
})
--]]
minetest.register_craft({
output = "was:sender",

View File

@ -56,8 +56,13 @@ end
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
if minetest.get_item_group(was.get_node(p),"was_resender")==0 and not vector.equals(pos,p) then
was.send(p,channel,msg,from_channel)
local na=was.get_node(p)
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

View File

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

View File

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