mirror of
http://repo.or.cz/minetest_pyramids/tsm_pyramids.git
synced 2024-12-22 23:40:18 +01:00
Fix some logging errors
This commit is contained in:
parent
4d25bdadf2
commit
4aa41e096f
18
init.lua
18
init.lua
@ -207,7 +207,7 @@ local function make(pos, brick, sandstone, stone, sand, ptype, room_id)
|
|||||||
-- Build entrance
|
-- Build entrance
|
||||||
make_entrance(bpos, rot, brick, sand, flood_sand)
|
make_entrance(bpos, rot, brick, sand, flood_sand)
|
||||||
-- Done
|
-- Done
|
||||||
minetest.log("action", "Created pyramid at "..minetest.pos_to_string(bpos)..".")
|
minetest.log("action", "[tsm_pyramids] Created pyramid at "..minetest.pos_to_string(bpos)..".")
|
||||||
return ok, msg
|
return ok, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
if noise1 > 0.25 or noise1 < -0.26 then
|
if noise1 > 0.25 or noise1 < -0.26 then
|
||||||
-- Need a bit of luck to place a pyramid
|
-- Need a bit of luck to place a pyramid
|
||||||
if math.random(0,10) > 7 then
|
if math.random(0,10) > 7 then
|
||||||
minetest.log("verbose", "[tsm_pyramids]", "Pyramid not placed, bad dice roll. minp="..minetest.pos_to_string(minp))
|
minetest.log("verbose", "[tsm_pyramids] Pyramid not placed, bad dice roll. minp="..minetest.pos_to_string(minp))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if p2 == nil then
|
if p2 == nil then
|
||||||
minetest.log("verbose", "[tsm_pyramids]", "Pyramid not placed, no suitable surface. minp="..minetest.pos_to_string(minp))
|
minetest.log("verbose", "[tsm_pyramids] Pyramid not placed, no suitable surface. minp="..minetest.pos_to_string(minp))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Select the material type by the most prominent node type
|
-- Select the material type by the most prominent node type
|
||||||
@ -307,16 +307,16 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
sand = sands[sand_cnt_max_id]
|
sand = sands[sand_cnt_max_id]
|
||||||
end
|
end
|
||||||
if p2.y < PYRA_MIN_Y then
|
if p2.y < PYRA_MIN_Y then
|
||||||
minetest.log("info", "[tsm_pyramids]", "Pyramid not placed, too deep. p2="..minetest.pos_to_string(p2))
|
minetest.log("info", "[tsm_pyramids] Pyramid not placed, too deep. p2="..minetest.pos_to_string(p2))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Now sink the pyramid until each corner of it is no longer floating in mid-air
|
-- Now sink the pyramid until each corner of it is no longer floating in mid-air
|
||||||
p2 = limit(p2, maxp)
|
p2 = limit(p2, maxp)
|
||||||
local oposses = {
|
local oposses = {
|
||||||
{x=p2.x,y=p2.y-1,z=p2.z},
|
{x=p2.x,y=p2.y-1,z=p2.z},
|
||||||
{x=p2.x+PYRA_W,y=p2.y-1,z=p2.z+PYRA_W},
|
{x=p2.x+PYRA_Wm,y=p2.y-1,z=p2.z+PYRA_Wm},
|
||||||
{x=p2.x+PYRA_W,y=p2.y-1,z=p2.z},
|
{x=p2.x+PYRA_Wm,y=p2.y-1,z=p2.z},
|
||||||
{x=p2.x,y=p2.y-1,z=p2.z+PYRA_W},
|
{x=p2.x,y=p2.y-1,z=p2.z+PYRA_Wm},
|
||||||
}
|
}
|
||||||
for o=1, #oposses do
|
for o=1, #oposses do
|
||||||
local opos = oposses[o]
|
local opos = oposses[o]
|
||||||
@ -331,7 +331,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
|
|
||||||
-- Bad luck, we have hit the chunk border!
|
-- Bad luck, we have hit the chunk border!
|
||||||
if p2.y < minp.y then
|
if p2.y < minp.y then
|
||||||
minetest.log("info", "[tsm_pyramids]", "Pyramid not placed, sunken too much. p2="..minetest.pos_to_string(p2))
|
minetest.log("info", "[tsm_pyramids] Pyramid not placed, sunken too much. p2="..minetest.pos_to_string(p2))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
|
|
||||||
minetest.find_node_near(middle, PYRA_W, {"default:dirt_with_grass"}) ~= nil or
|
minetest.find_node_near(middle, PYRA_W, {"default:dirt_with_grass"}) ~= nil or
|
||||||
minetest.find_node_near(middle, 52, {"default:sandstonebrick", "default:desert_sandstone_brick", "default:desert_stonebrick"}) ~= nil then
|
minetest.find_node_near(middle, 52, {"default:sandstonebrick", "default:desert_sandstone_brick", "default:desert_stonebrick"}) ~= nil then
|
||||||
minetest.log("info", "[tsm_pyramids]", "Pyramid not placed, inappropriate node nearby. p2="..minetest.pos_to_string(p2))
|
minetest.log("info", "[tsm_pyramids] Pyramid not placed, inappropriate node nearby. p2="..minetest.pos_to_string(p2))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user