From a7c4d4ebd9939e7f6c4c75a7fa6b17efe44c24e9 Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 8 Dec 2020 00:57:15 +0400 Subject: [PATCH] Fix obserber watch z coordinate in realtime mode --- mods/ITEMS/REDSTONE/mcl_observers/init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mcl_observers/init.lua b/mods/ITEMS/REDSTONE/mcl_observers/init.lua index 81bf745dd..841ab98b4 100644 --- a/mods/ITEMS/REDSTONE/mcl_observers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_observers/init.lua @@ -295,11 +295,11 @@ if realtime then if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).x==1 then mcl_observers.observer_activate({x=pos.x-1,y=pos.y,z=pos.z}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==-1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z+1}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z-1}) end @@ -322,11 +322,11 @@ if realtime then if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).x==1 then mcl_observers.observer_activate({x=pos.x-1,y=pos.y,z=pos.z}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==-1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z+1}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z-1}) end @@ -349,11 +349,11 @@ if realtime then if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).x==1 then mcl_observers.observer_activate({x=pos.x-1,y=pos.y,z=pos.z}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==-1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z+1}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z-1}) end @@ -376,11 +376,11 @@ if realtime then if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).x==1 then mcl_observers.observer_activate({x=pos.x-1,y=pos.y,z=pos.z}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==-1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z+1}) end - n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}) + n=minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}) if n and n.name and string.sub(n.name,1,24)=="mcl_observers:observer_o" and minetest.facedir_to_dir(n.param2).z==1 then mcl_observers.observer_activate({x=pos.x,y=pos.y,z=pos.z-1}) end