src/client/graphics/layers/RadialMenu.ts

This commit is contained in:
Scott Anderson
2025-05-14 22:15:36 -04:00
parent 61e0c0ca95
commit ef80b97b73
+4 -3
View File
@@ -289,12 +289,12 @@ export class RadialMenu implements Layer {
if (myPlayer === null || !myPlayer.isAlive()) return; if (myPlayer === null || !myPlayer.isAlive()) return;
const tile = this.g.ref(this.clickedCell.x, this.clickedCell.y); const tile = this.g.ref(this.clickedCell.x, this.clickedCell.y);
if (this.originalTileOwner.isPlayer()) { if (this.originalTileOwner.isPlayer()) {
if (this.g.owner(tile) != this.originalTileOwner) { if (this.g.owner(tile) !== this.originalTileOwner) {
this.closeMenu(); this.closeMenu();
return; return;
} }
} else { } else {
if (this.g.owner(tile).isPlayer() || this.g.owner(tile) == myPlayer) { if (this.g.owner(tile).isPlayer() || this.g.owner(tile) === myPlayer) {
this.closeMenu(); this.closeMenu();
return; return;
} }
@@ -392,7 +392,7 @@ export class RadialMenu implements Layer {
}); });
} }
if ( if (
actions.buildableUnits.find((bu) => bu.type == UnitType.TransportShip) actions.buildableUnits.find((bu) => bu.type === UnitType.TransportShip)
?.canBuild ?.canBuild
) { ) {
this.activateMenuElement(Slot.Boat, "#3f6ab1", boatIcon, () => { this.activateMenuElement(Slot.Boat, "#3f6ab1", boatIcon, () => {
@@ -404,6 +404,7 @@ export class RadialMenu implements Layer {
spawnTile = new Cell(this.g.x(spawn), this.g.y(spawn)); spawnTile = new Cell(this.g.x(spawn), this.g.y(spawn));
} }
if (this.clickedCell === null) return;
this.eventBus.emit( this.eventBus.emit(
new SendBoatAttackIntentEvent( new SendBoatAttackIntentEvent(
this.g.owner(tile).id(), this.g.owner(tile).id(),