From d68acad0fd4b6e0361b19f9e25749ac60bc0c89a Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 26 Sep 2021 15:46:35 +0200 Subject: [PATCH] add logging on chat command --- mods/ENVIRONMENT/mcl_weather/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/ENVIRONMENT/mcl_weather/init.lua b/mods/ENVIRONMENT/mcl_weather/init.lua index 34d53952..0386cf0a 100644 --- a/mods/ENVIRONMENT/mcl_weather/init.lua +++ b/mods/ENVIRONMENT/mcl_weather/init.lua @@ -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”.")