add logging on chat command

This commit is contained in:
cora 2021-09-26 15:46:35 +02:00
parent 015b29aa60
commit d68acad0fd
1 changed files with 2 additions and 0 deletions

View File

@ -284,6 +284,7 @@ minetest.register_chatcommand("weather", {
end
local def=mcl_weather.get_weatherdef(param)
local old_weather=mcl_weather.current
if def then
mcl_weather.stop_weather(mcl_weather.get_weatherdef(mcl_weather.state))
if duration then
@ -291,6 +292,7 @@ minetest.register_chatcommand("weather", {
def.max_duration=duration
end
mcl_weather.change(param,true)
minetest.log("action", "[mcl_weather] " .. name .. " changed the weather from " .. old_weather .. " to " .. param)
return true
end
return false, S("Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.")