I have changed the chat commands `\day` and `\night` again. Now they execute `core.set_timeofday(0.5)` and `core.set_timeofday(0)`. (Thanks to ShadowNinja)

This commit is contained in:
Maximilian 2014-11-10 06:46:53 +01:00
parent 63a462f0af
commit 523d0f9bd4
1 changed files with 6 additions and 8 deletions

View File

@ -631,23 +631,21 @@ core.register_chatcommand("time", {
}) })
core.register_chatcommand("day", { core.register_chatcommand("day", {
description = "set time of day to 10000", description = "set time of day to midday (12000)",
privs = {settime=true}, privs = {settime=true},
func = function(name, param) func = function(name, param)
local newtime = 10000 core.set_timeofday(0.5)
core.set_timeofday((newtime % 24000) / 24000) core.log("action", name .. " sets time " .. 12000)
core.log("action", name .. " sets time " .. newtime)
return true, "Time of day changed." return true, "Time of day changed."
end, end,
}) })
core.register_chatcommand("night", { core.register_chatcommand("night", {
description = "set time of day to 0", description = "set time of day to night (0)",
privs = {settime=true}, privs = {settime=true},
func = function(name, param) func = function(name, param)
local newtime = 0 core.set_timeofday(0)
core.set_timeofday((newtime % 24000) / 24000) core.log("action", name .. " sets time " .. 0)
core.log("action", name .. " sets time " .. newtime)
return true, "Time of day changed." return true, "Time of day changed."
end, end,
}) })