mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-30 00:38:39 +00:00
src/client/graphics/layers/RadialMenu.ts
This commit is contained in:
@@ -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(),
|
||||||
|
|||||||
Reference in New Issue
Block a user