diff options
author | cheapie <no-email-for-you@example.com> | 2024-04-20 11:17:46 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-04-20 11:17:46 -0500 |
commit | 77c32763509853e9b616bea162aaa904e27e304f (patch) | |
tree | d4fbf029313f8bb55bed9ab475d344050cea8d8c | |
parent | 9ef3620f6f29ba4ac10dcc8ea56daa3fa4908c56 (diff) | |
download | celevator-77c32763509853e9b616bea162aaa904e27e304f.tar celevator-77c32763509853e9b616bea162aaa904e27e304f.tar.gz celevator-77c32763509853e9b616bea162aaa904e27e304f.tar.bz2 celevator-77c32763509853e9b616bea162aaa904e27e304f.tar.xz celevator-77c32763509853e9b616bea162aaa904e27e304f.zip |
Fix crash in down call reassignment
-rw-r--r-- | dispatcherfw.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dispatcherfw.lua b/dispatcherfw.lua index 1314eb7..528adc7 100644 --- a/dispatcherfw.lua +++ b/dispatcherfw.lua @@ -559,7 +559,7 @@ elseif event.type == "abm" or event.iid == "run" then end end for i in pairs(mem.assignedup) do - if mem.upcalls[i] then + if mem.upcalls[i] and mem.upeta[i] then local eligiblecars = {} local permanent = false for _,carid in pairs(mem.params.carids) do @@ -623,7 +623,7 @@ elseif event.type == "abm" or event.iid == "run" then bestcar = carid end end - mem.upeta[i] = besteta + mem.dneta[i] = besteta if bestcar then send(bestcar,"groupdncall",realtocarfloor(bestcar,i)) mem.assigneddn[i] = bestcar @@ -633,7 +633,7 @@ elseif event.type == "abm" or event.iid == "run" then end end for i in pairs(mem.assigneddn) do - if mem.dncalls[i] then + if mem.dncalls[i] and mem.dneta[i] then local eligiblecars = {} for _,carid in pairs(mem.params.carids) do if mem.carstatus[carid].state == "normal" and mem.params.floorsserved[carid][i] then |