Fix pathfinding to coordinates

- Now possible to walk to given coordinates
- Fix sending location before it is received
This commit is contained in:
ORelio 2015-12-13 21:58:55 +01:00
parent b0c8f82697
commit 902b04656c
2 changed files with 8 additions and 5 deletions

View file

@ -32,6 +32,7 @@ namespace MinecraftClient
public void BotClear() { bots.Clear(); }
private object locationLock = new object();
private bool locationReceived = false;
private World world = new World();
private Queue<Location> steps;
private Queue<Location> path;
@ -356,6 +357,7 @@ namespace MinecraftClient
this.location += location;
}
else this.location = location;
locationReceived = true;
}
}
@ -468,7 +470,7 @@ namespace MinecraftClient
}
}
if (Settings.TerrainAndMovements)
if (Settings.TerrainAndMovements && locationReceived)
{
lock (locationLock)
{