Revert "Delay messages slightly so that results appear after expressions"
This reverts commit a57fcd5b4e9d54350d4822beffa1fc64f361cffc.
This commit is contained in:
parent
a57fcd5b4e
commit
335cf83c5c
17
console.lua
17
console.lua
@ -1,6 +1,5 @@
|
|||||||
local path = minetest.get_modpath(minetest.get_current_modname())
|
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||||
|
|
||||||
local after = minetest.after
|
|
||||||
local chat_send_player = minetest.chat_send_player
|
local chat_send_player = minetest.chat_send_player
|
||||||
local colorize = minetest.colorize
|
local colorize = minetest.colorize
|
||||||
local concat = table.concat
|
local concat = table.concat
|
||||||
@ -29,12 +28,6 @@ local function pack(...)
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
local function chat_send_player_delayed(name, s)
|
|
||||||
after(0, function()
|
|
||||||
chat_send_player(name, s)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
local g_environ = {
|
local g_environ = {
|
||||||
gmt = getmetatable, -- shorthand for getmetatable
|
gmt = getmetatable, -- shorthand for getmetatable
|
||||||
smt = setmetatable, -- shorthand for setmetatable
|
smt = setmetatable, -- shorthand for setmetatable
|
||||||
@ -106,12 +99,12 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
|
|
||||||
-- Clears the chat window.
|
-- Clears the chat window.
|
||||||
environ.clear = function()
|
environ.clear = function()
|
||||||
chat_send_player_delayed(name, bunch_of_lfs)
|
chat_send_player(name, bunch_of_lfs)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Sends message to player who called it.
|
-- Sends message to player who called it.
|
||||||
environ.echo = function(s)
|
environ.echo = function(s)
|
||||||
chat_send_player_delayed(name, s)
|
chat_send_player(name, s)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function load(name)
|
local function load(name)
|
||||||
@ -144,7 +137,7 @@ minetest.register_on_chat_message(function(name, s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if f == nil then
|
if f == nil then
|
||||||
chat_send_player_delayed(name, colorize('#F93', err))
|
chat_send_player(name, colorize('#F93', err))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -162,9 +155,9 @@ minetest.register_on_chat_message(function(name, s)
|
|||||||
|
|
||||||
if f[1] then
|
if f[1] then
|
||||||
env._ = f[2]
|
env._ = f[2]
|
||||||
chat_send_player_delayed(name, result)
|
chat_send_player(name, result)
|
||||||
else
|
else
|
||||||
env._e = f[2]
|
env._e = f[2]
|
||||||
chat_send_player_delayed(name, '(c@#F93)ERROR: ' .. result)
|
chat_send_player(name, '(c@#F93)ERROR: ' .. result)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user