diff options
author | cheapie <no-email-for-you@example.com> | 2024-07-19 17:30:25 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-07-19 17:30:25 -0500 |
commit | afc8b657a986456627e84734b703a2c3c2e307e2 (patch) | |
tree | a0bf1b42d8056e5c7c9c675543158886c4cea505 | |
parent | 7e8bdac31ee1f859db4156803c95fd248ed4cc5c (diff) | |
download | celevator-afc8b657a986456627e84734b703a2c3c2e307e2.tar celevator-afc8b657a986456627e84734b703a2c3c2e307e2.tar.gz celevator-afc8b657a986456627e84734b703a2c3c2e307e2.tar.bz2 celevator-afc8b657a986456627e84734b703a2c3c2e307e2.tar.xz celevator-afc8b657a986456627e84734b703a2c3c2e307e2.zip |
Fix crash if a machine is attempted to be paired to a dispatcher
-rw-r--r-- | drive_entity.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drive_entity.lua b/drive_entity.lua index f3025f6..a9792d8 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -711,7 +711,7 @@ local function updatecarpos(pos) meta:set_string("infotext",string.format("Using car with origin %s",minetest.pos_to_string(carpos))) local carid = meta:get_int("carid") local carinfo = minetest.deserialize(celevator.storage:get_string(string.format("car%d",carid))) - if not carinfo then return end + if not (carinfo and carinfo.controllerpos) then return end carinfo.origin = carpos celevator.storage:set_string(string.format("car%d",carid),minetest.serialize(carinfo)) local drivepos = celevator.controller.finddrive(carinfo.controllerpos) |