Sort the destinations from the start

Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
Chris Cromer 2019-10-11 12:33:13 -03:00
parent 804ab0acef
commit dbb524a7c7

View File

@ -306,6 +306,8 @@ public class Canvas extends java.awt.Canvas implements Constants {
player.getAi().addDestination(new State(key.getCell().getX(), key.getCell().getY(), State.Type.KEY, null, 0));
}
player.getAi().sortDestinations();
Thread thread = new Thread(player.getAi());
thread.start();
aiThreads.put(player.getAi(), thread);