diff options
author | cheapie <no-email-for-you@example.com> | 2024-05-11 12:05:00 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-05-11 12:05:00 -0500 |
commit | 1435944ad65abb21e340802fba0a011512e5cd91 (patch) | |
tree | 6d141b025fdca090b87b4d86fef04810e4ada1df | |
parent | 645b2944311fcf672cfa74e7612f58a706c12b8b (diff) | |
download | celevator-1435944ad65abb21e340802fba0a011512e5cd91.tar celevator-1435944ad65abb21e340802fba0a011512e5cd91.tar.gz celevator-1435944ad65abb21e340802fba0a011512e5cd91.tar.bz2 celevator-1435944ad65abb21e340802fba0a011512e5cd91.tar.xz celevator-1435944ad65abb21e340802fba0a011512e5cd91.zip |
Ring bell early for hall calls if the direction is known
-rw-r--r-- | controllerfw.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/controllerfw.lua b/controllerfw.lua index 0dbc48d..38ea654 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -1397,6 +1397,24 @@ mem.flash_blank = mem.nudging mem.lanterns = {} if mem.carstate == "normal" and (mem.doorstate == "open" or mem.doorstate == "opening") then mem.lanterns[getpos()] = mem.direction +elseif mem.carstate == "normal" and mem.doorstate == "closed" and mem.drive.status then + local ring = false + if mem.drive.status.vel > 0 and mem.drive.status.neareststop > mem.drive.status.dpos then + ring = true + elseif mem.drive.status.vel < 0 and mem.drive.status.neareststop < mem.drive.status.dpos then + ring = true + end + if ring then + for i=1,#mem.params.floornames,1 do + if gettarget(i) == mem.drive.status.dpos then + if mem.direction == "up" and mem.upcalls[i] then + mem.lanterns[i] = "up" + elseif mem.direction == "down" and mem.dncalls[i] then + mem.lanterns[i] = "down" + end + end + end + end end mem.copformspec = "formspec_version[7]" |