mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Do not sync world regions that are not yet loaded. Closes #15
This commit is contained in:
parent
832bacde06
commit
94427f33e7
1 changed files with 7 additions and 1 deletions
|
@ -83,7 +83,13 @@ function world_sync.host_upload()
|
|||
rect_optimiser:scan()
|
||||
|
||||
for crect in rect.parts(rect_optimiser:iterate(), 256) do
|
||||
local area = world.encode_area(chunk_map, crect.left, crect.top, crect.right, crect.bottom, encoded_area)
|
||||
local area = nil
|
||||
-- Make sure we don't send chunks that aren't loaded yet, like holy mountains before host got there.
|
||||
if DoesWorldExistAt(crect.left, crect.top, crect.right, crect.bottom) then
|
||||
area = world.encode_area(chunk_map, crect.left, crect.top, crect.right, crect.bottom, encoded_area)
|
||||
else
|
||||
-- Will probably need to try again later?
|
||||
end
|
||||
if area ~= nil then
|
||||
local str = ffi.string(area, world.encoded_size(area))
|
||||
if string.len(str) > bandwidth_bucket_max then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue