--- doors.old/init.lua +++ doors/init.lua @@ -145,7 +145,8 @@ else state = tonumber(state) end - + -- RJK: Bug fix + if state == nil then state = 0 end replace_old_owner_information(pos) if clicker and not default.can_interact_with_node(clicker, pos) then @@ -161,9 +162,17 @@ local dir = node.param2 + -- 190728 RJK: Crash fix + if transform == nil or + transform [state+1] == nil or + transform [state+1][dir+1] == nil then + return false + end + -- It's possible param2 is messed up, so, validate before using -- the input data. This indicates something may have rotated -- the door, even though that is not supported. + if not transform[state + 1] or not transform[state + 1][dir + 1] then return false end @@ -185,7 +194,6 @@ return true end - local function on_place_node(place_to, newnode, placer, oldnode, itemstack, pointed_thing) -- Run script hook