1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-27 15:10:20 +01:00

Remove unused variables and do some whitespace fixes

This commit is contained in:
HybridDog 2021-01-30 17:04:28 +01:00
parent dc799f344f
commit 76981af958
4 changed files with 20 additions and 20 deletions

View File

@ -4,7 +4,7 @@ minetest.register_abm({
nodenames = {"default:dirt_with_snow"},
interval = 2,
chance = 20,
action = function(pos, node)
action = function(pos)
local name = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore"
@ -37,9 +37,9 @@ minetest.register_abm({
if intensity == 1 then
minetest.set_node(pos, {name="default:water_source"})
elseif intensity == 2 then
minetest.set_node(pos, {name="default:water_flowing", param2=7})
minetest.set_node(pos, {name="default:water_flowing", param2=7})
elseif intensity == 3 then
minetest.set_node(pos, {name="default:water_flowing", param2=3})
minetest.set_node(pos, {name="default:water_flowing", param2=3})
--[[ LazyJ, you need to add param2, which defines the amount of the flowing water ~ HybridDog 2015_03_06
This was causing "melts=2" nodes to just disappear so I changed it to replace the
node with a water_source for a couple seconds and then replace the water_source with
@ -61,11 +61,11 @@ minetest.register_abm({
-- the water to flow and spread before the
-- water_source is changed to air. ~ LazyJ
if minetest.get_node(pos).name == "default:water_source" then
minetest.add_node(pos,{name="air"})
end
end)
minetest.add_node(pos,{name="air"})
end
end)
--]]
else
else
return
end
end,
@ -78,7 +78,7 @@ minetest.register_abm({
--Water freezes when in contact with snow.
minetest.register_abm({
nodenames = {"default:water_source"},
-- Added "group:icemaker" and snowbrick. ~ LazyJ
-- Added "group:icemaker" and snowbrick. ~ LazyJ
neighbors = {"default:snow", "default:snowblock", "snow:snow_brick", "group:icemaker"},
interval = 20,
chance = 4,
@ -144,7 +144,7 @@ minetest.register_abm({
nodenames = {"snow:sapling_pine"},
interval = 10,
chance = 50,
action = function(pos, node)
action = function(pos)
-- Check if there is enough vertical-space for the sapling to grow without
-- hitting anything else. ~ LazyJ, 2014_04_10
@ -177,7 +177,7 @@ minetest.register_abm({
nodenames = {"snow:xmas_tree"},
interval = 10,
chance = 50,
action = function(pos, node)
action = function(pos)
-- 'If' there is air in each of the 8 nodes dirctly above the sapling,... ~LazyJ
for i = 1,8 do

View File

@ -1,6 +1,6 @@
-- Parameters
function snow_fall(pos, player, animate)
function snow_fall(pos)
local ground_y = nil
for y=pos.y+10,pos.y+20,1 do
local n = minetest.get_node({x=pos.x,y=y,z=pos.z}).name
@ -128,7 +128,7 @@ if snow.enable_snowfall then
local freeze = nval_temp < 35
local precip = nval_prec < (nval_humid - 50) / 50 + PRECOFF and
nval_humid - grad * nval_temp > yint
if snow.debug then
precip = true
end
@ -173,9 +173,9 @@ if snow.enable_snowfall then
if freeze then
-- Snowfall
local extime = math.min((pposy + 12 - YLIMIT) / 2, 9)
local x, y, z = pposx - 24 + math.random(0, 48), pposy + 12, pposz - 24 + math.random(0, 48)
if not snow.lighter_snowfall then
snow_fall({
x = x,
@ -183,11 +183,11 @@ if snow.enable_snowfall then
z = z
}, true)
end
for flake = 1, FLAKES do
for _ = 1, FLAKES do
x, y, z = pposx - 24 + math.random(0, 48), pposy + 12, pposz - 24 + math.random(0, 48)
minetest.add_particle({
pos = {
x = x,

View File

@ -577,7 +577,7 @@ local biome_strings = {
{"snowy", "plain", "alpine", "normal", "normal"},
{"cool", "icebergs", "icesheet", "icecave", "icehole"}
}
function biome_to_string(num,num2)
function biome_to_string(num)
local biome = biome_strings[1][num] or "unknown "..num
return biome
end

View File

@ -156,7 +156,7 @@ function sled:on_rightclick(player)
on_sled_click(self, player)
end
function sled:on_activate(staticdata, dtime_s)
function sled:on_activate(staticdata)
self.object:set_armor_groups({immortal=1})
self.object:setacceleration({x=0, y=-10, z=0})
if staticdata then