Skip to content

Commit

Permalink
Catch all for 'running' bot threads somehow disassociated with any ac…
Browse files Browse the repository at this point in the history
…tive quadrant
  • Loading branch information
rumour committed Nov 3, 2013
1 parent 608a607 commit 0903bfd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/org/gamehost/jtrek/javatrek/TrekBot.java
Expand Up @@ -75,6 +75,13 @@ public void run() {
if (state == TrekPlayer.WAIT_DEAD)
break;

// still seeing an occasional BotPlayer thread that is running, but doesn't exist in the quadrant
if (ship.currentQuadrant.getShipByScanLetter(ship.scanLetter) != ship) {
Thread.sleep(250);
if (ship.currentQuadrant.getShipByScanLetter(ship.scanLetter) != ship) {
state = TrekPlayer.WAIT_DEAD;
}
}
Thread.sleep(1);
}
while (true);
Expand Down

0 comments on commit 0903bfd

Please sign in to comment.