1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-01-23 08:20:21 +01:00

fix error ,set_node at bad pos

This commit is contained in:
crabman77 2015-08-03 00:49:28 +02:00
parent 5dfaf02685
commit d1cf576e35

View File

@ -223,6 +223,7 @@ local yp = {x = pos.x, y = pos.y + 3, z = pos.z}
if minetest.get_node(pos).name == "seawrecks:woodship" and if minetest.get_node(pos).name == "seawrecks:woodship" and
(minetest.get_node(yp).name == "default:water_source" or (minetest.get_node(yp).name == "default:water_source" or
minetest.get_node(yp).name == "noairblocks:water_sourcex") then minetest.get_node(yp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "default:sand"})
local rot local rot
if math.random(1, 2) == 1 then if math.random(1, 2) == 1 then
rot = {"x", "z"} rot = {"x", "z"}
@ -388,9 +389,10 @@ local yp = {x = pos.x, y = pos.y + 3, z = pos.z}
pos[rot[2]] = pos[rot[2]] + 1 pos[rot[2]] = pos[rot[2]] + 1
pos[rot[1]] = pos[rot[1]] - 2 pos[rot[1]] = pos[rot[1]] - 2
minetest.add_node(pos, {name = "seawrecks:woodshipchest"}) minetest.add_node(pos, {name = "seawrecks:woodshipchest"})
end else
minetest.add_node(pos, {name = "default:sand"}) minetest.add_node(pos, {name = "default:sand"})
end end
end
}) })
minetest.register_abm({ minetest.register_abm({
@ -402,6 +404,7 @@ local yp = {x = pos.x, y = pos.y + 8, z = pos.z}
if minetest.get_node(pos).name == "seawrecks:uboot" and if minetest.get_node(pos).name == "seawrecks:uboot" and
(minetest.get_node(yp).name == "default:water_source" or (minetest.get_node(yp).name == "default:water_source" or
minetest.get_node(yp).name == "noairblocks:water_sourcex") then minetest.get_node(yp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "default:sand"})
local rot local rot
if math.random(1, 2) == 1 then if math.random(1, 2) == 1 then
rot = {"x", "z"} rot = {"x", "z"}
@ -957,7 +960,8 @@ local yp = {x = pos.x, y = pos.y + 8, z = pos.z}
pos[rot[1]] = pos[rot[1]] +16 pos[rot[1]] = pos[rot[1]] +16
pos[rot[2]] = pos[rot[2]] +3 pos[rot[2]] = pos[rot[2]] +3
minetest.set_node(pos, {name = "seawrecks:ubootchest"}) minetest.set_node(pos, {name = "seawrecks:ubootchest"})
end else
minetest.add_node(pos, {name = "default:sand"}) minetest.add_node(pos, {name = "default:sand"})
end end
end
}) })