From f73342b8a63a2a9f24a3cb83d906f67e0550802e Mon Sep 17 00:00:00 2001 From: cheapie Date: Sat, 20 Apr 2024 14:17:48 -0500 Subject: Fix for selecting cars that can't move in the direction selected --- dispatcherfw.lua | 16 ++++++++-------- 1 file 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 -- cgit v1.2.3