diff options
author | cheapie <no-email-for-you@example.com> | 2024-04-22 18:27:04 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-04-22 18:27:04 -0500 |
commit | 9a45990bee6fb2f3dfe346cecfcf0cc1703cf07c (patch) | |
tree | 347449ea230465dc504f9d7f0b8ec15d609be21d /controller.lua | |
parent | e29d179464abfda76d437b4dc03c57161dca40b0 (diff) | |
download | celevator-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.lua | 13 |
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) |