diff options
author | cheapie <no-email-for-you@example.com> | 2024-04-27 20:28:08 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-04-27 20:28:08 -0500 |
commit | 1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9 (patch) | |
tree | 6e625559e086a6fc96a5db48a1361f03eb5f02c0 | |
parent | 59faed0a54fd0e9e23bd79851b72f04cae6270c1 (diff) | |
download | celevator-1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9.tar celevator-1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9.tar.gz celevator-1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9.tar.bz2 celevator-1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9.tar.xz celevator-1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9.zip |
Turn around at the next available floor in phase 1 recall, not the original destination
-rw-r--r-- | controllerfw.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/controllerfw.lua b/controllerfw.lua index d0a4eb5..5fbe30c 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -784,7 +784,21 @@ elseif mem.fs1switch then mem.groupupcalls = {} mem.groupdncalls = {} interrupt(nil,"close") - if getpos() ~= (mem.params.mainlanding or 1) then + if mem.drive.status.vel > 0 and mem.drive.status.apos > gettarget(mem.params.mainlanding or 1) then + for i=getpos(),#mem.params.floornames,1 do + if mem.drive.status.neareststop < gettarget(i) and mem.drive.status.dpos > gettarget(i) then + gotofloor(i) + break + end + end + elseif mem.drive.status.vel < 0 and mem.drive.status.apos < gettarget(mem.params.mainlanding or 1) then + for i=1,getpos(),1 do + if mem.drive.status.neareststop > gettarget(i) and mem.drive.status.dpos < gettarget(i) then + gotofloor(i) + break + end + end + elseif getpos() ~= (mem.params.mainlanding or 1) then if not (mem.carmotion or juststarted) then if mem.doorstate == "closed" then gotofloor(mem.params.mainlanding or 1) |