Prevent translocator error on data loss.
This commit is contained in:
parent
3c41fa6a3f
commit
25ad0e3200
1 changed files with 2 additions and 1 deletions
|
@ -364,7 +364,7 @@ local function trans_place(itemstack, placer, pointed_thing)
|
|||
end
|
||||
local pos = pointed_thing.above
|
||||
local pair = fun_caves.db.translocators[tonumber(data.id)]
|
||||
if #pair > 1 then
|
||||
if not pair or #pair > 1 then
|
||||
print('* Fun Caves: high error in translocator storage')
|
||||
return
|
||||
end
|
||||
|
@ -395,6 +395,7 @@ local function trans_dig(pos, node, digger)
|
|||
local pair = fun_caves.db.translocators[tonumber(data.id)]
|
||||
if not pair or #pair < 1 then
|
||||
print('* Fun Caves: low error in translocator storage')
|
||||
minetest.remove_node(pos)
|
||||
return
|
||||
end
|
||||
local inv = digger:get_inventory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue