From afc8b657a986456627e84734b703a2c3c2e307e2 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 19 Jul 2024 17:30:25 -0500 Subject: Fix crash if a machine is attempted to be paired to a dispatcher --- drive_entity.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drive_entity.lua') 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) -- cgit v1.2.3