Fix up some straggling threading issues in Region

This commit is contained in:
Drew DeVault 2017-05-23 18:29:57 -04:00
parent 535437f51e
commit 2b130e816f

View File

@ -110,7 +110,7 @@ namespace TrueCraft.Core.World
nbt.LoadFromStream(regionFile, NbtCompression.ZLib, null);
var chunk = Chunk.FromNbt(nbt);
chunk.ParentRegion = this;
Chunks.Add(position, chunk);
Chunks[position] = chunk;
World.OnChunkLoaded(new ChunkLoadedEventArgs(chunk));
break;
default:
@ -148,12 +148,10 @@ namespace TrueCraft.Core.World
/// </summary>
public void SetChunk(Coordinates2D position, IChunk chunk)
{
if (!Chunks.ContainsKey(position))
Chunks.Add(position, chunk);
Chunks[position] = chunk;
chunk.IsModified = true;
DirtyChunks.Add(position);
chunk.ParentRegion = this;
Chunks[position] = chunk;
}
/// <summary>