summaryrefslogtreecommitdiff
path: root/dispatcherfw.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-20 14:17:48 -0500
committercheapie <no-email-for-you@example.com>2024-04-20 14:17:48 -0500
commitf73342b8a63a2a9f24a3cb83d906f67e0550802e (patch)
treeada2dbb2e45d7ab2f34bb22a00b6f11c7316f392 /dispatcherfw.lua
parent88a24a1fe8186fb81347ff2d61903ddfdb1752bc (diff)
downloadcelevator-f73342b8a63a2a9f24a3cb83d906f67e0550802e.tar
celevator-f73342b8a63a2a9f24a3cb83d906f67e0550802e.tar.gz
celevator-f73342b8a63a2a9f24a3cb83d906f67e0550802e.tar.bz2
celevator-f73342b8a63a2a9f24a3cb83d906f67e0550802e.tar.xz
celevator-f73342b8a63a2a9f24a3cb83d906f67e0550802e.zip
Fix for selecting cars that can't move in the direction selected
Diffstat (limited to 'dispatcherfw.lua')
-rw-r--r--dispatcherfw.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/dispatcherfw.lua b/dispatcherfw.lua
index 337c0b8..d376439 100644
--- a/dispatcherfw.lua
+++ b/dispatcherfw.lua
@@ -537,8 +537,8 @@ elseif event.type == "abm" or event.iid == "run" then
for _,carid in pairs(mem.params.carids) do
if mem.carstatus[carid].state == "normal" and mem.params.floorsserved[carid][i] then
local serveshigher = false
- for floor in pairs(mem.params.floorsserved[carid]) do
- if floor > i then
+ for floor,served in pairs(mem.params.floorsserved[carid]) do
+ if floor > i and served then
serveshigher = true
break
end
@@ -571,8 +571,8 @@ elseif event.type == "abm" or event.iid == "run" then
if getdpos(carid) == i and mem.carstatus[carid].direction == "up" then permanent = true end
if mem.carstatus[carid].state == "normal" and mem.params.floorsserved[carid][i] then
local serveshigher = false
- for floor in pairs(mem.params.floorsserved[carid]) do
- if floor > i then
+ for floor,served in pairs(mem.params.floorsserved[carid]) do
+ if floor > i and served then
serveshigher = true
break
end
@@ -609,8 +609,8 @@ elseif event.type == "abm" or event.iid == "run" then
if getdpos(carid) == i and mem.carstatus[carid].direction == "down" then permanent = true end
if mem.carstatus[carid].state == "normal" and mem.params.floorsserved[carid][i] then
local serveslower = false
- for floor in pairs(mem.params.floorsserved[carid]) do
- if floor < i then
+ for floor,served in pairs(mem.params.floorsserved[carid]) do
+ if floor < i and served then
serveslower = true
break
end
@@ -643,8 +643,8 @@ elseif event.type == "abm" or event.iid == "run" then
for _,carid in pairs(mem.params.carids) do
if mem.carstatus[carid].state == "normal" and mem.params.floorsserved[carid][i] then
local serveslower = false
- for floor in pairs(mem.params.floorsserved[carid]) do
- if floor < i then
+ for floor,served in pairs(mem.params.floorsserved[carid]) do
+ if floor < i and served then
serveslower = true
break
end