From 2b411bba5354d0bafa0a1e9e232b457e1479ade3 Mon Sep 17 00:00:00 2001 From: theFox6 Date: Sun, 29 Apr 2018 18:50:51 +0200 Subject: [PATCH] quick fix --- .luacheckrc | 1 + weather/api.lua | 4 ++-- weather/command.lua | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 81e1561..05111a2 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -4,4 +4,5 @@ read_globals = { "minetest", "dump", "vector", "VoxelManip", "VoxelArea", + table = { fields = { "copy" } } } \ No newline at end of file diff --git a/weather/api.lua b/weather/api.lua index c173bbd..6ce4f55 100644 --- a/weather/api.lua +++ b/weather/api.lua @@ -47,7 +47,7 @@ function weather_mod.register_downfall(id,def) ndef.amount = 10 end if not ndef.exptime then - ndef.exptime = ndef.max_pos.y / (math.sqr(ndef.falling_acceleration) + ndef.falling_speed) + ndef.exptime = ndef.max_pos.y / (math.sqrt(ndef.falling_acceleration) + ndef.falling_speed) end if not ndef.texture then error("no texture given") @@ -60,7 +60,7 @@ end minetest.register_globalstep(function() if weather.type=="none" then - for id,el in pairs(weather_mod.registered_downfalls) do + for id,_ in pairs(weather_mod.registered_downfalls) do if math.random(1, 50000) == 1 then weather.wind = {} weather.wind.x = math.random(0,10) diff --git a/weather/command.lua b/weather/command.lua index 2b7f51a..f1a8734 100644 --- a/weather/command.lua +++ b/weather/command.lua @@ -6,7 +6,8 @@ minetest.register_privilege("weather", { -- Set weather minetest.register_chatcommand("setweather", { params = "", - description = "Set weather to a registered type of downfall or show all types when nor parameters are given", -- full description + description = "Set weather to a registered type of downfall\ + show all types when nor parameters are given", -- full description privs = {weather = true}, func = function(name, param) if param == nil or param == "" then