fix setting names in 5.0+

master
flux 2020-06-03 23:13:03 +00:00
parent 6f25e31ff9
commit 8762b46e7c
2 changed files with 5 additions and 7 deletions

View File

@ -3,7 +3,7 @@ minetest CSM which records sent and received messages in the minetest log file.
requirements
------------
tested with minetest 0.4.17 and 5.0.
tested with minetest 0.4.17 and 5.0 through 5.3-dev-ee831ed6e.
only basic CSM need be enabled in 5.0, which is the default.

View File

@ -31,19 +31,17 @@ local function safe(func)
end
local set_my_name_tries = 0
local set_my_name = safe(function()
local function set_my_name()
if minetest.localplayer then
my_name = minetest.localplayer:get_name()
end
if set_my_name_tries < 20 then
elseif set_my_name_tries < 20 then
set_my_name_tries = set_my_name_tries + 1
minetest.after(1, set_my_name)
else
my_name = ''
log('warning', 'could not set name!')
return
end
end)
end
if minetest.register_on_connect then