forked from Mineclonia/Mineclonia
add logging on chat command
This commit is contained in:
parent
015b29aa60
commit
d68acad0fd
|
@ -284,6 +284,7 @@ minetest.register_chatcommand("weather", {
|
||||||
end
|
end
|
||||||
|
|
||||||
local def=mcl_weather.get_weatherdef(param)
|
local def=mcl_weather.get_weatherdef(param)
|
||||||
|
local old_weather=mcl_weather.current
|
||||||
if def then
|
if def then
|
||||||
mcl_weather.stop_weather(mcl_weather.get_weatherdef(mcl_weather.state))
|
mcl_weather.stop_weather(mcl_weather.get_weatherdef(mcl_weather.state))
|
||||||
if duration then
|
if duration then
|
||||||
|
@ -291,6 +292,7 @@ minetest.register_chatcommand("weather", {
|
||||||
def.max_duration=duration
|
def.max_duration=duration
|
||||||
end
|
end
|
||||||
mcl_weather.change(param,true)
|
mcl_weather.change(param,true)
|
||||||
|
minetest.log("action", "[mcl_weather] " .. name .. " changed the weather from " .. old_weather .. " to " .. param)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false, S("Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.")
|
return false, S("Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.")
|
||||||
|
|
Loading…
Reference in New Issue