Risk Bug ...
From Talk:BrokenSword
Jump to navigation
Jump to search
Revision as of 16 July 2012 at 10:35.
This is the thread's initial revision.
This is the thread's initial revision.
Hi mate. I was just looking at the code of BrokenSword and it looks like you have a little bug in your evalDestinationRisk(..) method:
for (EnemyData enemy1 : enemiesCollection) {
double distSq = enemy1.distanceSq(destination);
int closer = 0;
for (EnemyData enemy2 : enemiesCollection) {
if (enemy1.distanceSq(enemy2) < distSq) {
closer++;
}
}
To me it looks like, that you need a "enemy1 != enemy2" check in the second loop. Maybe you have fixed this already, in that case - never mind :).
Take Care