summaryrefslogtreecommitdiff
path: root/controller.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-22 18:27:04 -0500
committercheapie <no-email-for-you@example.com>2024-04-22 18:27:04 -0500
commit9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c (patch)
tree347449ea230465dc504f9d7f0b8ec15d609be21d /controller.lua
parente29d179464abfda76d437b4dc03c57161dca40b0 (diff)
downloadcelevator-9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c.tar
celevator-9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c.tar.gz
celevator-9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c.tar.bz2
celevator-9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c.tar.xz
celevator-9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c.zip
Prevent doors getting stuck open if the server shuts down while open
Diffstat (limited to 'controller.lua')
-rw-r--r--controller.lua13
1 files changed, 3 insertions, 10 deletions
diff --git a/controller.lua b/controller.lua
index 287983e..6e5cd78 100644
--- a/controller.lua
+++ b/controller.lua
@@ -384,16 +384,9 @@ minetest.register_node("celevator:controller_top_open_running",{
},
})
-function celevator.controller.iscontroller(pos,call2)
- local node = minetest.get_node(pos)
- if node.name == "ignore" and not call2 then
- minetest.forceload_block(pos)
- return celevator.controller.iscontroller(pos,true)
- elseif node.name == "celevator:controller" or node.name == "celevator:controller_open" then
- return true
- else
- return false
- end
+function celevator.controller.iscontroller(pos)
+ local node = celevator.get_node(pos)
+ return (node.name == "celevator:controller" or node.name == "celevator:controller_open")
end
function celevator.controller.finddrive(pos)