diff options
author | cheapie <no-email-for-you@example.com> | 2024-08-29 17:20:53 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-08-29 17:20:53 -0500 |
commit | e5edbece2bf4a28d4ff4751dc2337561207a9b92 (patch) | |
tree | 5f89334d92f9e42b73ccf8e81924cff5089ab1e9 /drive_entity.lua | |
parent | 571bdaf927040ca08f31dd7ca631db8038b6d356 (diff) | |
download | celevator-e5edbece2bf4a28d4ff4751dc2337561207a9b92.tar celevator-e5edbece2bf4a28d4ff4751dc2337561207a9b92.tar.gz celevator-e5edbece2bf4a28d4ff4751dc2337561207a9b92.tar.bz2 celevator-e5edbece2bf4a28d4ff4751dc2337561207a9b92.tar.xz celevator-e5edbece2bf4a28d4ff4751dc2337561207a9b92.zip |
Constant pressure control for car top inspection
Car will now continue moving if the up/down buttons on the car top box are held, instead of stopping every 1m. When the buttons are released, it will stop at the next multiple of 1m.
Diffstat (limited to 'drive_entity.lua')
-rw-r--r-- | drive_entity.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drive_entity.lua b/drive_entity.lua index f26bf11..ecbabdf 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -541,9 +541,9 @@ function celevator.drives.entity.moveto(pos,target,inspection) local apos = tonumber(meta:get_string("apos")) local vel = tonumber(meta:get_string("vel")) if vel > 0 then - if target < apos+(vel*2) then return end + if target < apos+(vel*2) and not inspection then return end elseif vel < 0 then - if target > apos-(vel*-2) then return end + if target > apos-(vel*-2) and not inspection then return end else return end |