mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Fix infinite loop in chunk sending logic in plane changer
This commit is contained in:
parent
1b2d50b7af
commit
53f5d9e400
1 changed files with 7 additions and 3 deletions
|
@ -326,17 +326,21 @@ namespace Nibriboard.Client
|
|||
CurrentViewPort = workingViewport;
|
||||
|
||||
List<ChunkReference> initialChunks = new List<ChunkReference>();
|
||||
ChunkReference currentChunkRef = new ChunkReference(CurrentPlane, CurrentViewPort.X, CurrentViewPort.Y);
|
||||
ChunkReference currentChunkRef = new ChunkReference(
|
||||
CurrentPlane,
|
||||
CurrentViewPort.X / CurrentPlane.ChunkSize,
|
||||
CurrentViewPort.Y / CurrentPlane.ChunkSize
|
||||
);
|
||||
while(CanSee(currentChunkRef))
|
||||
{
|
||||
while(CanSee(currentChunkRef))
|
||||
{
|
||||
initialChunks.Add(currentChunkRef);
|
||||
currentChunkRef = currentChunkRef.Clone() as ChunkReference;
|
||||
currentChunkRef.X += CurrentPlane.ChunkSize;
|
||||
currentChunkRef.X++;
|
||||
}
|
||||
currentChunkRef.X = CurrentViewPort.X;
|
||||
currentChunkRef.Y += CurrentPlane.ChunkSize;
|
||||
currentChunkRef.Y++;
|
||||
}
|
||||
|
||||
await SendChunks(initialChunks);
|
||||
|
|
Loading…
Reference in a new issue