diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-17 20:09:36 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-18 09:28:39 +0100 |
commit | 27d4e89d326337c8d8cafc681acde8bfbde7de77 (patch) | |
tree | 05122a05a2178adf57c5ac8b1038fb8eaefef46b /builtin | |
parent | b019221c30f58ce1944d8f2421b40b31ba364716 (diff) | |
download | minetest-27d4e89d326337c8d8cafc681acde8bfbde7de77.tar.gz minetest-27d4e89d326337c8d8cafc681acde8bfbde7de77.tar.bz2 minetest-27d4e89d326337c8d8cafc681acde8bfbde7de77.zip |
Fix unused (and so, broken) enable_rollback_recording. This option must be reloaded at server loop but loaded when server starts, for data consistency (not a hot load variable)
ok @ShadowNinja
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/chatcommands.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua index 2d94817e8..91b685fdf 100644 --- a/builtin/game/chatcommands.lua +++ b/builtin/game/chatcommands.lua @@ -570,6 +570,9 @@ core.register_chatcommand("rollback_check", { .. " seconds=86400=24h, limit=5)", privs = {rollback=true}, func = function(name, param) + if not core.setting_getbool("enable_rollback_recording") then + return false, "Rollback functions are disabled." + end local range, seconds, limit = param:match("(%d+) *(%d*) *(%d*)") range = tonumber(range) or 0 @@ -583,6 +586,10 @@ core.register_chatcommand("rollback_check", { local name = puncher:get_player_name() core.chat_send_player(name, "Checking " .. core.pos_to_string(pos) .. "...") local actions = core.rollback_get_node_actions(pos, range, seconds, limit) + if not actions then + core.chat_send_player(name, "Rollback functions are disabled") + return + end local num_actions = #actions if num_actions == 0 then core.chat_send_player(name, "Nobody has touched" @@ -614,6 +621,9 @@ core.register_chatcommand("rollback", { description = "revert actions of a player; default for <seconds> is 60", privs = {rollback=true}, func = function(name, param) + if not core.setting_getbool("enable_rollback_recording") then + return false, "Rollback functions are disabled." + end local target_name, seconds = string.match(param, ":([^ ]+) *(%d*)") if not target_name then local player_name = nil |