Fix issue with disappearing chunks on re-render

This commit is contained in:
Drew DeVault 2015-09-28 08:35:21 -04:00
parent 7b5154ff6f
commit 53987d2d52
2 changed files with 5 additions and 3 deletions

View File

@ -105,7 +105,6 @@ namespace TrueCraft.Client.Modules
} }
} }
if (any) if (any)
// In theory this would ready the chunks, but it doesn't work for some reason
Game.FlushMainThreadActions(); Game.FlushMainThreadActions();
} }

View File

@ -250,14 +250,17 @@ namespace TrueCraft.Client
public void FlushMainThreadActions() public void FlushMainThreadActions()
{ {
Action action; Action action;
if (PendingMainThreadActions.TryTake(out action)) while (PendingMainThreadActions.TryTake(out action))
action(); action();
} }
protected override void Update(GameTime gameTime) protected override void Update(GameTime gameTime)
{ {
GameTime = gameTime; GameTime = gameTime;
FlushMainThreadActions();
Action action;
if (PendingMainThreadActions.TryTake(out action))
action();
IChunk chunk; IChunk chunk;
var adjusted = Client.World.World.FindBlockPosition( var adjusted = Client.World.World.FindBlockPosition(