diff options
-rw-r--r-- | drive_entity.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drive_entity.lua b/drive_entity.lua index 3c3f555..5a2eed8 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -836,6 +836,13 @@ minetest.register_node("celevator:machine",{ local carid = tonumber(fields.carid) local carinfo = minetest.deserialize(celevator.storage:get_string(string.format("car%d",carid))) if not carinfo then return end + local oldmachinepos = carinfo.machinepos + if oldmachinepos then + local oldmachine = celevator.get_node(oldmachinepos) + if oldmachine.name == "celevator:machine" then + return + end + end carinfo.machinepos = pos celevator.storage:set_string(string.format("car%d",carid),minetest.serialize(carinfo)) local meta = minetest.get_meta(pos) |