fix boat only captures single tile bug

This commit is contained in:
evanpelle
2024-09-21 20:32:39 -07:00
parent c87d0ef3b8
commit e559af941f
6 changed files with 9 additions and 11 deletions
+2 -1
View File
@@ -273,9 +273,10 @@ export class ClientGame {
}
const tn = Array.from(bfs(tile, dist(tile, 10)))
.filter(t => t.isOceanShore())
.filter(t => t.owner() != this.myPlayer)
.sort((a, b) => manhattanDist(tile.cell(), a.cell()) - manhattanDist(tile.cell(), b.cell()))
if (tn.length > 0) {
this.sendBoatAttackIntent(targetID, tn[0].cell(), this.gs.config().boatAttackAmount(this.myPlayer, owner))
this.sendBoatAttackIntent(tn[0].owner().id(), tn[0].cell(), this.gs.config().boatAttackAmount(this.myPlayer, owner))
}
}
}