summaryrefslogtreecommitdiff
path: root/drive_entity.lua
diff options
context:
space:
mode:
Diffstat (limited to 'drive_entity.lua')
-rw-r--r--drive_entity.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/drive_entity.lua b/drive_entity.lua
index c2f88e6..1b33d43 100644
--- a/drive_entity.lua
+++ b/drive_entity.lua
@@ -837,7 +837,9 @@ function celevator.drives.entity.pibeep(drivepos)
end
local function carsearch(pos)
- for i=1,500,1 do
+ local maxdistance = tonumber(core.settings:get("celevator.max_height")) or 500
+ maxdistance = math.max(1,maxdistance)
+ for i=1,maxdistance,1 do
local searchpos = vector.subtract(pos,vector.new(0,i,0))
local node = celevator.get_node(searchpos)
if core.get_item_group(node.name,"_celevator_car") == 1 then