diff options
author | cheapie <no-email-for-you@example.com> | 2024-05-21 19:43:27 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-05-21 19:43:27 -0500 |
commit | 58ac782a8a3418702e8c525d852466030a65db25 (patch) | |
tree | db3c5aa17cf57f9c0234f068801e5dbb8ea1fe27 /laptop.lua | |
parent | 80fcd72450fcdce2a42f8d9f36d61ab75f4dd293 (diff) | |
download | celevator-58ac782a8a3418702e8c525d852466030a65db25.tar celevator-58ac782a8a3418702e8c525d852466030a65db25.tar.gz celevator-58ac782a8a3418702e8c525d852466030a65db25.tar.bz2 celevator-58ac782a8a3418702e8c525d852466030a65db25.tar.xz celevator-58ac782a8a3418702e8c525d852466030a65db25.zip |
Fix car calls entered via dispatcher by laptop interface being at wrong floors if above a skipped floor
Diffstat (limited to 'laptop.lua')
-rw-r--r-- | laptop.lua | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -394,11 +394,21 @@ laptop.register_app("celevator",{ local car = tonumber(string.sub(k,8,9)) local floor = tonumber(string.sub(k,10,-1)) if car and floor then + local map = {} + for i=1,#dmem.params.floornames,1 do + if dmem.params.floorsserved[dmem.params.carids[car]][i] then + table.insert(map,i) + end + end + local pmap = {} + for k2,v in pairs(map) do + pmap[v] = k2 + end celevator.dispatcher.run(pos,{ type = "remotemsg", channel = "carcall", car = car, - floor = floor, + floor = pmap[floor], }) end elseif string.sub(k,1,6) == "upcall" then |