diff options
| -rw-r--r-- | controllerfw.lua | 20 | ||||
| -rw-r--r-- | dbdkiosk.lua | 1 | ||||
| -rw-r--r-- | dispatcherfw.lua | 6 | ||||
| -rw-r--r-- | drive_entity.lua | 2 |
4 files changed, 23 insertions, 6 deletions
diff --git a/controllerfw.lua b/controllerfw.lua index 75ecb4d..a904154 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -368,7 +368,7 @@ elseif event.type == "ui" then table.remove(mem.params.floorheights,mem.editingfloor) table.remove(mem.params.floornames,mem.editingfloor) mem.editingfloor = math.max(1,mem.editingfloor-1) - elseif event.fields.moveup then + elseif event.fields.moveup and mem.editingfloor < #mem.params.floornames then local height = mem.params.floorheights[mem.editingfloor] local name = mem.params.floornames[mem.editingfloor] table.remove(mem.params.floorheights,mem.editingfloor) @@ -376,7 +376,7 @@ elseif event.type == "ui" then table.insert(mem.params.floorheights,mem.editingfloor+1,height) table.insert(mem.params.floornames,mem.editingfloor+1,name) mem.editingfloor = mem.editingfloor + 1 - elseif event.fields.movedown then + elseif event.fields.movedown and mem.editingfloor > 1 then local height = mem.params.floorheights[mem.editingfloor] local name = mem.params.floornames[mem.editingfloor] table.remove(mem.params.floorheights,mem.editingfloor) @@ -521,10 +521,26 @@ elseif event.type == "ui" then if event.fields.back then mem.screenstate = "status" elseif event.fields.clear then + local wasfatalfaulted = mem.fatalfault mem.faultlog = {} mem.activefaults = {} mem.fatalfault = false drivecmd({command = "resetfault"}) + if wasfatalfaulted then + mem.carstate = "bfdemand" + if mem.doorstate == "closed" then + drivecmd({ + command = "setmaxvel", + maxvel = mem.params.contractspeed, + }) + drivecmd({command = "resetpos"}) + interrupt(0.1,"checkdrive") + mem.carmotion = true + juststarted = true + else + close() + end + end end elseif mem.screenstate == "carcallsecurity" then if event.fields.indepunlock then diff --git a/dbdkiosk.lua b/dbdkiosk.lua index 8fa9946..4d15403 100644 --- a/dbdkiosk.lua +++ b/dbdkiosk.lua @@ -73,6 +73,7 @@ function celevator.dbdkiosk.handlefields(pos,_,fields,player) if screenstate == "connect" then if not (fields.save and celevator.dbdkiosk.checkprot(pos,name)) then return end if not (tonumber(fields.carid) and tonumber(fields.landing)) then return end + if tonumber(fields.landing) ~= math.floor(tonumber(fields.landing)) then return end local carinfo = core.deserialize(celevator.storage:get_string(string.format("car%d",fields.carid))) if not carinfo then return end if not (carinfo.dispatcherpos and celevator.dispatcher.isdispatcher(carinfo.dispatcherpos)) then return end diff --git a/dispatcherfw.lua b/dispatcherfw.lua index 4d6aa82..814f773 100644 --- a/dispatcherfw.lua +++ b/dispatcherfw.lua @@ -397,7 +397,7 @@ elseif event.type == "ui" then table.remove(mem.params.floorheights,mem.editingfloor) table.remove(mem.params.floornames,mem.editingfloor) mem.editingfloor = math.max(1,mem.editingfloor-1) - elseif event.fields.moveup then + elseif event.fields.moveup and mem.editingfloor < #mem.params.floornames then local height = mem.params.floorheights[mem.editingfloor] local name = mem.params.floornames[mem.editingfloor] table.remove(mem.params.floorheights,mem.editingfloor) @@ -405,7 +405,7 @@ elseif event.type == "ui" then table.insert(mem.params.floorheights,mem.editingfloor+1,height) table.insert(mem.params.floornames,mem.editingfloor+1,name) mem.editingfloor = mem.editingfloor + 1 - elseif event.fields.movedown then + elseif event.fields.movedown and mem.editingfloor > 1 then local height = mem.params.floorheights[mem.editingfloor] local name = mem.params.floornames[mem.editingfloor] table.remove(mem.params.floorheights,mem.editingfloor) @@ -955,7 +955,7 @@ elseif mem.screenstate == "oobe_floortable" or mem.screenstate == "floortable" t end fs("textlist[1,2;6,7;floor;") for i=#mem.params.floornames,1,-1 do - local floortext = S("@1 - Height: @2 - PI: @3",i,mem.params.floorheights[i],mem.params.floornames[i]) + local floortext = S("@1 - Height: @2 - PI: @3",i,mem.params.floorheights[i] or "??",mem.params.floornames[i] or "??") fs(core.formspec_escape(floortext)..(i==1 and "" or ",")) end fs(";"..tostring(#mem.params.floornames-mem.editingfloor+1)..";false]") diff --git a/drive_entity.lua b/drive_entity.lua index e2d2655..c2f88e6 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -999,7 +999,7 @@ core.register_node("celevator:machine",{ local oldmachinepos = carinfo.machinepos if oldmachinepos then local oldmachine = celevator.get_node(oldmachinepos) - if oldmachine.name == "celevator:machine" then + if oldmachine.name == "celevator:machine" and not vector.equals(pos,oldmachinepos) then return end end |
