mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
make and enable chunk map on clients
This commit is contained in:
parent
eaa74dd772
commit
3dcd6b4ec8
5 changed files with 147 additions and 90 deletions
|
@ -3,6 +3,18 @@ local module = {}
|
|||
local ptt = 0
|
||||
|
||||
function module.on_world_update()
|
||||
if GameGetFrameNum() % 8 == 7 then
|
||||
local s = ""
|
||||
for peer, data in pairs(ctx.players) do
|
||||
local x, y = EntityGetTransform(data.entity)
|
||||
if x == nil then
|
||||
return
|
||||
end
|
||||
s = s .. " " .. tostring(peer) .. " " .. math.floor(x) .. " " .. math.floor(y)
|
||||
end
|
||||
net.proxy_send("players_pos", string.sub(s, 2, -1))
|
||||
end
|
||||
|
||||
if GameGetFrameNum() % 4 ~= 2 then
|
||||
return
|
||||
end
|
||||
|
@ -62,19 +74,4 @@ function module.on_world_update()
|
|||
)
|
||||
end
|
||||
|
||||
function module.on_world_update_host()
|
||||
if GameGetFrameNum() % 8 ~= 2 then
|
||||
return
|
||||
end
|
||||
local s = ""
|
||||
for peer, data in pairs(ctx.players) do
|
||||
local x, y = EntityGetTransform(data.entity)
|
||||
if x == nil then
|
||||
return
|
||||
end
|
||||
s = s .. " " .. tostring(peer) .. " " .. math.floor(x) .. " " .. math.floor(y)
|
||||
end
|
||||
net.proxy_send("players_pos", string.sub(s, 2, -1))
|
||||
end
|
||||
|
||||
return module
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue