From 1357787d82c509391d13e1dc25039e6f58aa71ae Mon Sep 17 00:00:00 2001 From: evanpelle Date: Wed, 2 Oct 2024 17:39:16 -0700 Subject: [PATCH] must right click near coast for boat option --- TODO.txt | 2 +- src/client/graphics/layers/RadialMenu.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/TODO.txt b/TODO.txt index 5319da25a..b05075bd2 100644 --- a/TODO.txt +++ b/TODO.txt @@ -154,7 +154,7 @@ * add request attack other players DONE 10/2/2024 * Improve alliance icon DONE 10/2/2024 * BUG: center button should be disabled select island DONE 10/2/2024 -* BUG: boat icon appears when click inland +* BUG: boat icon appears when click inland DONE 10/2/2024 * BUG: double tap zooms on mobile * Make fake humans spawn by their country * add emoji button diff --git a/src/client/graphics/layers/RadialMenu.ts b/src/client/graphics/layers/RadialMenu.ts index ab75fd27c..55469ca7a 100644 --- a/src/client/graphics/layers/RadialMenu.ts +++ b/src/client/graphics/layers/RadialMenu.ts @@ -305,6 +305,17 @@ export class RadialMenu implements Layer { return } + let nearOcean = false + for (const t of bfs(tile, and(t => t.owner() == tile.owner() && t.isLand(), dist(tile, 25)))) { + if (t.isOceanShore()) { + nearOcean = true + break + } + } + if (!nearOcean) { + return + } + if (myPlayerBordersOcean && otherPlayerBordersOcean) { const [src, dst] = sourceDstOceanShore(this.game, myPlayer, other, this.clickedCell) if (src != null && dst != null) {