mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 20:51:15 +00:00
fix boat distance wrapping bug
This commit is contained in:
@@ -82,10 +82,18 @@
|
|||||||
* show next game in menu DONE 9/2/2024
|
* show next game in menu DONE 9/2/2024
|
||||||
* BUG: attacks starts slow but gets faster DONE 9/2/2024
|
* BUG: attacks starts slow but gets faster DONE 9/2/2024
|
||||||
* BUG: can't join game if click with 1s before start DONE 9/2/2024
|
* BUG: can't join game if click with 1s before start DONE 9/2/2024
|
||||||
|
* boat not going around world dist vs distwrapped DONE 9/2/2024
|
||||||
|
|
||||||
* test & deploy game
|
* test & deploy game
|
||||||
|
|
||||||
--- v2 Release
|
--- v2 Release
|
||||||
|
|
||||||
|
* names don't appear when zoomed out
|
||||||
|
* don't join game for reason
|
||||||
|
* make names bigger
|
||||||
|
* send boat even if touching
|
||||||
|
* put number of troops ui
|
||||||
|
* boats leave trails
|
||||||
* more random names for game id & client id
|
* more random names for game id & client id
|
||||||
* Make fake humans
|
* Make fake humans
|
||||||
* directed expansion
|
* directed expansion
|
||||||
|
|||||||
@@ -180,9 +180,6 @@ export class ClientGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private inputEvent(event: MouseDownEvent) {
|
private inputEvent(event: MouseDownEvent) {
|
||||||
// if (this.turns.length < this.config.turnsUntilGameStart()) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
if (!this.isActive) {
|
if (!this.isActive) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,14 +138,14 @@ export class BoatAttackExecution implements Execution {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private closestShoreTileToTarget(player: Player, target: Cell): Tile | null {
|
private closestShoreTileToTarget(player: Player, target: Cell): Tile | null {
|
||||||
const shoreTiles = Array.from(player.borderTiles()).filter(t => t.onShore() && t.neighbors().filter(n => n.isOcean()).length > 0)
|
const shoreTiles = Array.from(player.borderTiles()).filter(t => t.isOceanShore())
|
||||||
if (shoreTiles.length == 0) {
|
if (shoreTiles.length == 0) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return shoreTiles.reduce((closest, current) => {
|
return shoreTiles.reduce((closest, current) => {
|
||||||
const closestDistance = manhattanDist(target, closest.cell());
|
const closestDistance = manhattanDistWrapped(target, closest.cell(), this.mg.width());
|
||||||
const currentDistance = manhattanDist(target, current.cell());
|
const currentDistance = manhattanDistWrapped(target, current.cell(), this.mg.width());
|
||||||
return currentDistance < closestDistance ? current : closest;
|
return currentDistance < closestDistance ? current : closest;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user