From 58ac782a8a3418702e8c525d852466030a65db25 Mon Sep 17 00:00:00 2001 From: cheapie Date: Tue, 21 May 2024 19:43:27 -0500 Subject: Fix car calls entered via dispatcher by laptop interface being at wrong floors if above a skipped floor --- laptop.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/laptop.lua b/laptop.lua index 23a5fe5..5a9fe27 100644 --- a/laptop.lua +++ b/laptop.lua @@ -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 -- cgit v1.2.3