diff --git a/docs/issues.txt b/docs/issues.txt index 379d7e55..73d771dd 100644 --- a/docs/issues.txt +++ b/docs/issues.txt @@ -9,9 +9,6 @@ ISSUES: Bugs, Cleanup and Refinements # # # # # # # # # # # # #### # #### # ###### ###### # # #### -- Active lenses facing each other go apeshit. - - They also totally bog the game down with lighting recalcs. - - Optics should be blockable by things in item form. - If sunlight_propagates on the node, and it's groups.visinv, then also check sunlight_propagates of the item def if the diff --git a/mods/nc_optics/lens.lua b/mods/nc_optics/lens.lua index 47debbbe..92f6512f 100644 --- a/mods/nc_optics/lens.lua +++ b/mods/nc_optics/lens.lua @@ -8,16 +8,21 @@ local modname = minetest.get_current_modname() local function lens_check(pos, node, check) local face = nodecore.facedirs[node.param2] - if check(face.k) then + local backfed = check(face.k) + if backfed and node.name == modname .. ":lens" then return modname .. ":lens_glow" end local fore = vector.add(pos, face.f) - local ll = minetest.get_node_light(fore) - if not ll then return end - local lt = 15 - if node and node.name == modname .. ":lens_on" then lt = 14 end - local on = ll >= lt and face.f.y == 1 + local on + if face.f.y == 1 then + local ll = minetest.get_node_light(fore) + if ll then + local lt = 15 + if node and node.name == modname .. ":lens_on" then lt = 14 end + on = ll >= lt and face.f.y == 1 + end + end if not on then local nnode = minetest.get_node(fore) local def = minetest.registered_items[nnode.name] or {} @@ -26,6 +31,11 @@ local function lens_check(pos, node, check) if on then return modname .. ":lens_on", {face.k} end + + if backfed then + return modname .. ":lens_glow" + end + return modname .. ":lens" end