mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2024-12-29 17:07:35 +01:00
Fix possible crash and wireless receptors in unloaded map blocks (#22)
Co-authored-by: sys4 <bricassa@sys4.fr>
This commit is contained in:
parent
74a95e559e
commit
1dab017abe
@ -262,6 +262,9 @@ local function on_digiline_receive(pos, node, channel, msg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local wls = moremesecons.get_data_from_pos(wireless_meta, pos)
|
local wls = moremesecons.get_data_from_pos(wireless_meta, pos)
|
||||||
|
if not wls then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if wls.owner == "" or not wireless[wls.owner] or channel == "" or not wireless[wls.owner][wls.channel] then
|
if wls.owner == "" or not wireless[wls.owner] or channel == "" or not wireless[wls.owner][wls.channel] then
|
||||||
return
|
return
|
||||||
@ -274,7 +277,7 @@ local function on_digiline_receive(pos, node, channel, msg)
|
|||||||
|
|
||||||
sending_digilines[pos_hash] = true
|
sending_digilines[pos_hash] = true
|
||||||
for i, wl_pos in pairs(wireless[wls.owner][wls.channel].members) do
|
for i, wl_pos in pairs(wireless[wls.owner][wls.channel].members) do
|
||||||
if i ~= wls.id and check_wireless_exists(wl_pos) then
|
if i ~= wls.id then
|
||||||
digiline:receptor_send(wl_pos, digiline.rules.default, channel, msg)
|
digiline:receptor_send(wl_pos, digiline.rules.default, channel, msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user