diff options
| -rw-r--r-- | controllerfw.lua | 6 | ||||
| -rw-r--r-- | dispatcherfw.lua | 2 | ||||
| -rw-r--r-- | drive_entity.lua | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/controllerfw.lua b/controllerfw.lua index 129fa71..fe23066 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -397,7 +397,7 @@ elseif event.type == "ui" then if event.fields.back or event.fields.save then mem.screenstate = (mem.screenstate == "oobe_floortable_edit" and "oobe_floortable" or "floortable") local height = tonumber(event.fields.height) - if height then + if height and height < (tonumber(core.settings:get("celevator.max_height")) or 100) then height = math.floor(height+0.5) mem.params.floorheights[mem.editingfloor] = math.max(1,height) end @@ -481,10 +481,10 @@ elseif event.type == "ui" then end end end - if event.fields.scrollup then + if event.fields.scrollup and (mem.screenpage-1)*10+1 < #mem.params.floornames then mem.screenpage = mem.screenpage + 1 mem.scrollfollowscar = false - elseif event.fields.scrolldown then + elseif event.fields.scrolldown and mem.screenpage > 1 then mem.screenpage = mem.screenpage - 1 mem.scrollfollowscar = false elseif event.fields.scrollfollowscar then diff --git a/dispatcherfw.lua b/dispatcherfw.lua index 250a4d1..7793091 100644 --- a/dispatcherfw.lua +++ b/dispatcherfw.lua @@ -420,7 +420,7 @@ elseif event.type == "ui" then if event.fields.back or event.fields.save then mem.screenstate = (mem.screenstate == "oobe_floortable_edit" and "oobe_floortable" or "floortable") local height = tonumber(event.fields.height) - if height then + if height and height < (tonumber(core.settings:get("celevator.max_height")) or 100) then height = math.floor(height+0.5) mem.params.floorheights[mem.editingfloor] = math.max(1,height) end diff --git a/drive_entity.lua b/drive_entity.lua index 10ce0e2..71cba85 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -721,7 +721,7 @@ function celevator.drives.entity.moveto(pos,target,inspection) meta:set_string("fault","badorigin") return end - if target < 0 or origin.y + target > (carinfo.machinepos.y-3) then + if target < 0 or origin.y + target > (carinfo.machinepos.y-3) or target ~= target then meta:set_string("fault","outofbounds") return end @@ -790,6 +790,7 @@ end function celevator.drives.entity.setmaxvel(pos,maxvel) + if maxvel ~= maxvel then return end local meta = celevator.get_meta(pos) meta:set_string("maxvel",tostring(maxvel)) end |
