aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2016-02-08 22:20:04 +0100
committerparamat <mat.gregory@virginmedia.com>2016-02-11 04:22:58 +0000
commitb1428ab4bb1e2cf73bc8ac951d41d22203ea68a0 (patch)
tree6cc3abacb6afef178ead78405277ae161e31c7dd /builtin/game
parent47464c9344a1a4817ad6e4c6ec44526df305b1f6 (diff)
downloadminetest-b1428ab4bb1e2cf73bc8ac951d41d22203ea68a0.tar.gz
minetest-b1428ab4bb1e2cf73bc8ac951d41d22203ea68a0.tar.bz2
minetest-b1428ab4bb1e2cf73bc8ac951d41d22203ea68a0.zip
Add '/clearobjects quick'
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/chatcommands.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index fff893b28..9557a27c4 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -848,14 +848,24 @@ core.register_chatcommand("kick", {
})
core.register_chatcommand("clearobjects", {
+ params = "[full|quick]",
description = "clear all objects in world",
privs = {server=true},
func = function(name, param)
+ options = {}
+ if param == "" or param == "full" then
+ options.mode = "full"
+ elseif param == "quick" then
+ options.mode = "quick"
+ else
+ return false, "Invalid usage, see /help clearobjects."
+ end
+
core.log("action", name .. " clears all objects.")
core.chat_send_all("Clearing all objects. This may take long."
.. " You may experience a timeout. (by "
.. name .. ")")
- core.clear_objects()
+ core.clear_objects(options)
core.log("action", "Object clearing done.")
core.chat_send_all("*** Cleared all objects.")
end,