summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-05-21 19:43:27 -0500
committercheapie <no-email-for-you@example.com>2024-05-21 19:43:27 -0500
commit58ac782a8a3418702e8c525d852466030a65db25 (patch)
treedb3c5aa17cf57f9c0234f068801e5dbb8ea1fe27
parent80fcd72450fcdce2a42f8d9f36d61ab75f4dd293 (diff)
downloadcelevator-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
-rw-r--r--laptop.lua12
1 files changed, 11 insertions, 1 deletions
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