summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-09-01 14:26:38 -0500
committercheapie <no-email-for-you@example.com>2024-09-01 14:26:38 -0500
commit873001197a25eaaeefcaea91ebddd424301be809 (patch)
tree66b573c71ab1e2288b596bb031b8ed11923a7eab
parent0062af63594ca2fe9c234b4aa982ec0372dd6f09 (diff)
downloadcelevator-873001197a25eaaeefcaea91ebddd424301be809.tar
celevator-873001197a25eaaeefcaea91ebddd424301be809.tar.gz
celevator-873001197a25eaaeefcaea91ebddd424301be809.tar.bz2
celevator-873001197a25eaaeefcaea91ebddd424301be809.tar.xz
celevator-873001197a25eaaeefcaea91ebddd424301be809.zip
Fix possible crash when floor tables are updated
-rw-r--r--controllerfw.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/controllerfw.lua b/controllerfw.lua
index 885a5a9..0b2e590 100644
--- a/controllerfw.lua
+++ b/controllerfw.lua
@@ -100,6 +100,7 @@ local function gettarget(floor)
local target = 0
if floor == 1 then return 0 end
for i=1,floor-1,1 do
+ if not mem.params.floorheights[i] then return 0 end
target = target+mem.params.floorheights[i]
end
return target