forked from minetest-mods/MoreMesecons
Fix unworking wireless when the wireless LBM is enabled
This commit is contained in:
parent
23dd415bbe
commit
eebb82f48b
@ -50,6 +50,9 @@ end
|
|||||||
|
|
||||||
local set_channel
|
local set_channel
|
||||||
local function set_owner(pos, owner)
|
local function set_owner(pos, owner)
|
||||||
|
if not owner or owner == "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", owner)
|
meta:set_string("owner", owner)
|
||||||
set(wireless_meta.owners, pos.z,pos.y,pos.x, owner)
|
set(wireless_meta.owners, pos.z,pos.y,pos.x, owner)
|
||||||
@ -75,13 +78,14 @@ function set_channel(pos, channel)
|
|||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
if not owner then
|
if owner == "" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local old_channel = meta:get_string("channel")
|
local old_channel = meta:get_string("channel")
|
||||||
if old_channel then
|
if old_channel and old_channel ~= channel then
|
||||||
remove_wireless(pos)
|
remove_wireless(pos)
|
||||||
|
set_owner(pos, owner)
|
||||||
end
|
end
|
||||||
|
|
||||||
meta:set_string("channel", channel)
|
meta:set_string("channel", channel)
|
||||||
@ -103,15 +107,13 @@ local function register_wireless(pos)
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
if not owner then
|
if owner == "" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not wireless[owner] then
|
set_owner(pos, owner)
|
||||||
wireless[owner] = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
local channel = meta:get_string("channel")
|
local channel = meta:get_string("channel")
|
||||||
if channel then
|
if channel ~= "" then
|
||||||
set_channel(pos, channel)
|
set_channel(pos, channel)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user