1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-29 16:00:16 +01:00

change debug comment

This commit is contained in:
HybridDog 2015-05-26 20:55:13 +02:00
parent 062a451bc7
commit 0708ea6af3
3 changed files with 11 additions and 34 deletions

View File

@ -22,32 +22,13 @@ local np_ice = {
-- Debugging function
local biome_to_string = function(num,num2)
local biome, biome2
if num == 1 then
biome = "snowy"
elseif num == 2 then
biome = "plain"
elseif num == 3 then
biome = "alpine"
elseif num == 4 or num == 5 then
biome = "normal"
else
biome = "unknown "..num
end
if num2 == 1 then
biome2 = "cool"
elseif num2 == 2 then
biome2 = "icebergs"
elseif num2 == 3 then
biome2 = "icesheet"
elseif num2 == 4 then
biome2 = "icecave"
elseif num2 == 5 then
biome2 = "icehole"
else
biome2 = "unknown "..num
end
local biome_strings = {
{"snowy", "plain", "alpine", "normal", "normal"},
{"cool", "icebergs", "icesheet", "icecave", "icehole"}
}
local function biome_to_string(num,num2)
local biome = biome_strings[1][num] or "unknown "..num
local biome2 = biome_strings[2][num2] or "unknown "..num2
return biome, biome2
end
@ -61,11 +42,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
local x1 = maxp.x
local z1 = maxp.z
local debug = snow.debug
local min_height = snow.min_height
local spawn_pine = snow.voxelmanip_pine
local smooth = snow.smooth_biomes
local legacy = snow.legacy
local c_dirt_with_grass = minetest.get_content_id("default:dirt_with_grass")
local c_dirt = minetest.get_content_id("default:dirt")
@ -93,7 +71,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
local sidelen = x1 - x0 + 1
local chulens = {x=sidelen, y=sidelen, z=sidelen}
local minpos = {x=x0, y=z0}
local nvals_cold = minetest.get_perlin_map(np_cold, chulens):get2dMap_flat({x=x0, y=z0})
local nvals_ice = minetest.get_perlin_map(np_ice, chulens):get2dMap_flat({x=x0, y=z0})
@ -305,7 +282,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
vm:calc_lighting()
vm:write_to_map()
if write_to_map and debug then -- print if any column of mapchunk was snow biome
if write_to_map
and snow.debug then -- print if any column of mapchunk was snow biome
local biome_string,biome2_string = biome_to_string(biome,biome2)
local chugent = math.ceil((os.clock() - t1) * 1000)
print("[snow] "..biome_string.." and "..biome2_string.." x "..minp.x.." z "..minp.z.." time "..chugent.." ms")

View File

@ -161,8 +161,7 @@ function sled:on_step(dtime)
p.y = p.y+0.4
local s = self.object:getpos()
s.y = s.y -0.5
local keys = self.driver:get_player_control()
if keys["sneak"]
if self.driver:get_player_control().sneak
or is_water(p)
or not minetest.find_node_near(s, 1, {"default:snow","default:snowblock","default:ice","default:dirt_with_snow", "group:icemaker"}) then -- LazyJ
self.driver:set_physics_override({

View File

@ -17,7 +17,7 @@ local doc = {
sleds = "Disable this to prevent sleds from being riden.",
enable_snowfall = "Enables falling snow.",
lighter_snowfall = "Reduces the amount of resources and fps used by snowfall.",
debug = "Enables debug output.",
debug = "Enables debug output. Currently it only prints mgapgen_v6 info.",
smooth_biomes = "Enables smooth transition of biomes",
christmas_content = "Disable this to remove christmas saplings from being found.",
smooth_snow = "Disable this to stop snow from being smoothed.",