From 6856fc39790ed0ec912148d7fff91a9b95808e65 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 18 Aug 2023 18:15:31 -0500 Subject: Assorted bug fixes --- controller.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'controller.lua') 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 -- cgit v1.2.3