diff options
author | cheapie <no-email-for-you@example.com> | 2023-08-18 18:15:31 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2023-08-18 18:15:31 -0500 |
commit | 6856fc39790ed0ec912148d7fff91a9b95808e65 (patch) | |
tree | 4acef5505564dbc4b2fd8f681daa3f4ab98ccd90 /controller.lua | |
parent | e35e98148acff3c7da7b9b70619ae625fef0bbef (diff) | |
download | celevator-6856fc39790ed0ec912148d7fff91a9b95808e65.tar celevator-6856fc39790ed0ec912148d7fff91a9b95808e65.tar.gz celevator-6856fc39790ed0ec912148d7fff91a9b95808e65.tar.bz2 celevator-6856fc39790ed0ec912148d7fff91a9b95808e65.tar.xz celevator-6856fc39790ed0ec912148d7fff91a9b95808e65.zip |
Assorted bug fixes
Diffstat (limited to 'controller.lua')
-rw-r--r-- | controller.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/controller.lua b/controller.lua index 3de026c..8d6b210 100644 --- a/controller.lua +++ b/controller.lua @@ -400,7 +400,7 @@ function celevator.controller.finddrive(pos) return drivepos,minetest.registered_nodes[drivename]._celevator_drive_type end -function celevator.controller.finish(pos,mem) +function celevator.controller.finish(pos,mem,changedinterrupts) if not celevator.controller.iscontroller(pos) then return else @@ -416,9 +416,11 @@ function celevator.controller.finish(pos,mem) elseif command.command == "estop" then celevator.drives[drivetype].estop(drivepos) elseif command.command == "open" then - celevator.drives[drivetype].movedoors(drivepos,"open") + minetest.after(0.25,celevator.drives[drivetype].movedoors,drivepos,"open") elseif command.command == "close" then celevator.drives[drivetype].movedoors(drivepos,"close") + elseif command.command == "resetfault" then + celevator.drives[drivetype].resetfault(drivepos) end end end @@ -479,7 +481,10 @@ function celevator.controller.finish(pos,mem) meta:set_string("formspec_hidden",mem.formspec or "") meta:set_string("infotext",mem.infotext or "") local hash = minetest.hash_node_position(pos) - celevator.controller.iqueue[hash] = mem.interrupts + if not celevator.controller.iqueue[hash] then celevator.controller.iqueue[hash] = mem.interrupts end + for iid in pairs(changedinterrupts) do + celevator.controller.iqueue[hash][iid] = mem.interrupts[iid] + end celevator.storage:set_string("controller_iqueue",minetest.serialize(celevator.controller.iqueue)) controllerleds(pos,mem.showrunning) celevator.controller.running[hash] = nil |