summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2026-05-25 15:51:06 -0500
committercheapie <no-email-for-you@example.com>2026-05-25 15:51:06 -0500
commitff3d25190bc08a29c2c0f11b32c67dfc26ae0fde (patch)
treeae4eab0ba5b98b26dff9dbdc5255e5edcfd214f8
parent85ac97aaeb5bfb9d4f96595e8597c6d7ce3d1889 (diff)
downloadcelevator-ff3d25190bc08a29c2c0f11b32c67dfc26ae0fde.tar
celevator-ff3d25190bc08a29c2c0f11b32c67dfc26ae0fde.tar.gz
celevator-ff3d25190bc08a29c2c0f11b32c67dfc26ae0fde.tar.bz2
celevator-ff3d25190bc08a29c2c0f11b32c67dfc26ae0fde.tar.xz
celevator-ff3d25190bc08a29c2c0f11b32c67dfc26ae0fde.zip
Fix more rare crashesHEADmain
I've only seen these break when players do weird stuff with the intention of breaking things
-rw-r--r--controllerfw.lua14
-rw-r--r--mesecons.lua4
2 files changed, 11 insertions, 7 deletions
diff --git a/controllerfw.lua b/controllerfw.lua
index a904154..ca8dad8 100644
--- a/controllerfw.lua
+++ b/controllerfw.lua
@@ -843,19 +843,19 @@ elseif event.type == "dispatchermsg" then
end
elseif event.channel == "getstatus" then
send(event.source,"status",mem)
- elseif event.channel == "groupupcall" and mem.carstate == "normal" then
+ elseif event.channel == "groupupcall" and mem.carstate == "normal" and event.msg then
mem.groupupcalls[event.msg] = true
- elseif event.channel == "groupdncall" and mem.carstate == "normal" then
+ elseif event.channel == "groupdncall" and mem.carstate == "normal" and event.msg then
mem.groupdncalls[event.msg] = true
- elseif event.channel == "groupupcancel" then
+ elseif event.channel == "groupupcancel" and event.msg then
mem.groupupcalls[event.msg] = nil
- elseif event.channel == "groupdncancel" then
+ elseif event.channel == "groupdncancel" and event.msg then
mem.groupdncalls[event.msg] = nil
- elseif event.channel == "swingupcall" and swingstateok then
+ elseif event.channel == "swingupcall" and swingstateok and event.msg then
mem.swingupcalls[event.msg] = true
- elseif event.channel == "swingdncall" and swingstateok then
+ elseif event.channel == "swingdncall" and swingstateok and event.msg then
mem.swingdncalls[event.msg] = true
- elseif event.channel == "carcall" and (mem.carstate == "normal" or mem.carstate == "swing") then
+ elseif event.channel == "carcall" and (mem.carstate == "normal" or mem.carstate == "swing") and event.msg then
mem.carcalls[event.msg] = true
send(event.source,"status",mem)
elseif event.channel == "fs1switch" then
diff --git a/mesecons.lua b/mesecons.lua
index 51917ed..b126381 100644
--- a/mesecons.lua
+++ b/mesecons.lua
@@ -657,6 +657,10 @@ core.register_abm({
end
end
if not def then return end
+ if not mem.upcalls then
+ --Memory ended up blank somehow
+ return
+ end
local newstate = def.func(mem,floor)
if newstate ~= oldstate then
node.name = (newstate and "celevator:mesecons_output_on" or "celevator:mesecons_output_off")