Wait for TOSERVER_CLIENT_READY before requesting CSMs.

This commit is contained in:
luk3yx 2020-03-03 22:51:53 +13:00
parent 84a27551de
commit 8c3d961cd6
2 changed files with 14 additions and 0 deletions

View File

@ -269,6 +269,13 @@ end)
-- Send "0"
local function request_csms(c)
-- Don't request SSCSMs until TOSERVER_CLIENT_READY has been sent.
-- There is no callback for this, polling must be used instead.
if not minetest.localplayer then
minetest.after(0.05, request_csms, c)
return
end
base_env._raw.minetest.localplayer = minetest.localplayer
base_env._raw.minetest.camera = minetest.camera
c = c or 10

View File

@ -344,6 +344,13 @@ end)
-- Send "0"
local function request_csms(c)
-- Don't request SSCSMs until TOSERVER_CLIENT_READY has been sent.
-- There is no callback for this, polling must be used instead.
if not minetest.localplayer then
minetest.after(0.05, request_csms, c)
return
end
base_env._raw.minetest.localplayer = minetest.localplayer
base_env._raw.minetest.camera = minetest.camera
c = c or 10