mirror of
https://github.com/minetest/minetest.git
synced 2024-09-27 15:00:30 +02:00
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:
parent
63a462f0af
commit
523d0f9bd4
|
@ -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,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user