From 1e2c5e046c9af0c511f78fa7e88dd6b0eb6c7ef9 Mon Sep 17 00:00:00 2001 From: cheapie Date: Sat, 27 Apr 2024 20:28:08 -0500 Subject: Turn around at the next available floor in phase 1 recall, not the original destination --- controllerfw.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3