mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 19:50:23 -04:00
Don't send empty entity update packets every server tick.
This commit is contained in:
parent
e459c5c943
commit
f65c83ee0d
@ -273,6 +273,10 @@ fn sendEntityUpdates(comptime getInitialList: bool, allocator: utils.NeverFailin
|
||||
updateList.array.append(.null);
|
||||
updateList.array.appendSlice(world.?.itemDropManager.lastUpdates.array.items);
|
||||
}
|
||||
if(!getInitialList and updateList.array.items.len == 0) {
|
||||
world.?.itemDropManager.mutex.unlock();
|
||||
return;
|
||||
}
|
||||
const updateData = updateList.toStringEfficient(main.stackAllocator, &.{});
|
||||
defer main.stackAllocator.free(updateData);
|
||||
if(world.?.itemDropManager.lastUpdates.array.items.len != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user