code beautification

This commit is contained in:
theFox6 2018-04-14 08:07:11 +02:00
parent fc8f4533fa
commit 58929624ca
4 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ minetest.register_chatcommand("setweather", {
params = "<weather>",
description = "Set weather to rain, snow or none", -- full description
privs = {weather = true},
func = function(name, param)
func = function(_, param) --name, param
weather.type = param
save_weather()
end

View File

@ -24,7 +24,7 @@ end
weather = read_weather()
minetest.register_globalstep(function(dtime)
minetest.register_globalstep(function()
if weather.type == "rain" or weather.type == "snow" then
if math.random(1, 10000) == 1 then
weather.type = "none"

View File

@ -1,5 +1,5 @@
-- Rain
minetest.register_globalstep(function(dtime)
minetest.register_globalstep(function()
if weather.type ~= "rain" then return end
for _, player in ipairs(minetest.get_connected_players()) do
local ppos = player:getpos()

View File

@ -1,5 +1,5 @@
-- Snow
minetest.register_globalstep(function(dtime)
minetest.register_globalstep(function()
if weather.type ~= "snow" then return end
for _, player in ipairs(minetest.get_connected_players()) do
local ppos = player:getpos()
@ -55,7 +55,7 @@ minetest.register_node("weather:snow_cover", {
minetest.register_abm({
nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"},
neighbors = {"default:air"},
interval = 10.0,
interval = 10.0,
chance = 80,
action = function (pos, node, active_object_count, active_object_count_wider)
if weather == "snow" then