aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-07-27 13:24:28 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-07-27 13:24:28 +0300
commita9d8df83d228635594b75a563a0a8d906b3b883a (patch)
tree547e16d22ebef3e35a65e1dc3cf6368f5f5ec331 /builtin
parent508b7b5e51bd2e193fb182bb9247555154d78087 (diff)
downloadminetest-a9d8df83d228635594b75a563a0a8d906b3b883a.tar.gz
minetest-a9d8df83d228635594b75a563a0a8d906b3b883a.tar.bz2
minetest-a9d8df83d228635594b75a563a0a8d906b3b883a.zip
Make the rollback system VERY FUCKING GOD DAMN POWERFUL
Diffstat (limited to 'builtin')
-rw-r--r--builtin/chatcommands.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua
index 28b5f4b1f..8e4639955 100644
--- a/builtin/chatcommands.lua
+++ b/builtin/chatcommands.lua
@@ -520,6 +520,7 @@ minetest.register_chatcommand("rollback_check", {
dump(range).." seconds="..dump(seconds).."s)")
minetest.rollback_punch_callbacks[name] = function(pos, node, puncher)
local name = puncher:get_player_name()
+ minetest.chat_send_player(name, "Checking...")
local actor, act_p, act_seconds =
minetest.rollback_get_last_node_actor(pos, range, seconds)
if actor == "" then
@@ -531,8 +532,10 @@ minetest.register_chatcommand("rollback_check", {
if act_p.x ~= pos.x or act_p.y ~= pos.y or act_p.z ~= pos.z then
nodedesc = minetest.pos_to_string(act_p)
end
- minetest.chat_send_player(name, "Last actor on "..nodedesc.." was "..
- actor..", "..dump(act_seconds).."s ago")
+ local nodename = minetest.env:get_node(act_p).name
+ minetest.chat_send_player(name, "Last actor on "..nodedesc..
+ " was "..actor..", "..dump(act_seconds)..
+ "s ago (node is now "..nodename..")")
end
end,
})
@@ -557,8 +560,12 @@ minetest.register_chatcommand("rollback", {
dump(target_name).." since "..dump(seconds).." seconds.")
local success, log = minetest.rollback_revert_actions_by(
target_name, seconds)
- for _,line in ipairs(log) do
- minetest.chat_send_player(name, line)
+ if #log > 10 then
+ minetest.chat_send_player(name, "(log is too long to show)")
+ else
+ for _,line in ipairs(log) do
+ minetest.chat_send_player(name, line)
+ end
end
if success then
minetest.chat_send_player(name, "Reverting actions succeeded.")