]> git.lizzy.rs Git - minetest.git/blobdiff - builtin/game/chatcommands.lua
Set acceleration only once in falling node
[minetest.git] / builtin / game / chatcommands.lua
index 6b4ca0d12df4f4d6417296abfdcf107cc43549b6..0b197664081bae00a22916eb40c88be1f3c81482 100644 (file)
@@ -116,7 +116,7 @@ core.register_chatcommand("help", {
                        local cmds = {}
                        for cmd, def in pairs(core.chatcommands) do
                                if core.check_player_privs(name, def.privs) then
-                                       table.insert(cmds, cmd)
+                                       cmds[#cmds + 1] = cmd
                                end
                        end
                        table.sort(cmds)
@@ -127,7 +127,7 @@ core.register_chatcommand("help", {
                        local cmds = {}
                        for cmd, def in pairs(core.chatcommands) do
                                if core.check_player_privs(name, def.privs) then
-                                       table.insert(cmds, format_help_line(cmd, def))
+                                       cmds[#cmds + 1] = format_help_line(cmd, def)
                                end
                        end
                        table.sort(cmds)
@@ -135,7 +135,7 @@ core.register_chatcommand("help", {
                elseif param == "privs" then
                        local privs = {}
                        for priv, def in pairs(core.registered_privileges) do
-                               table.insert(privs, priv .. ": " .. def.description)
+                               privs[#privs + 1] = priv .. ": " .. def.description
                        end
                        table.sort(privs)
                        return true, "Available privileges:\n"..table.concat(privs, "\n")
@@ -785,6 +785,13 @@ core.register_chatcommand("time", {
        end,
 })
 
+core.register_chatcommand("days", {
+       description = "Display day count",
+       func = function(name, param)
+               return true, "Current day is " .. core.get_day_count()
+       end
+})
+
 core.register_chatcommand("shutdown", {
        description = "shutdown server",
        privs = {server=true},