mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 14:00:54 +00:00
bugfix: don't show build icon in radial during spawn phase, bugfix: log warning and hide playerpanel if tile not owned by player
This commit is contained in:
@@ -184,7 +184,9 @@ export class PlayerPanel extends LitElement implements Layer {
|
||||
|
||||
let other = this.g.owner(this.tile);
|
||||
if (!other.isPlayer()) {
|
||||
throw new Error("Tile is not owned by a player");
|
||||
this.hide();
|
||||
console.warn("Tile is not owned by a player");
|
||||
return;
|
||||
}
|
||||
other = other as PlayerView;
|
||||
|
||||
|
||||
@@ -350,9 +350,12 @@ export class RadialMenu implements Layer {
|
||||
actions: PlayerActions,
|
||||
tile: TileRef,
|
||||
) {
|
||||
this.activateMenuElement(Slot.Build, "#ebe250", buildIcon, () => {
|
||||
this.buildMenu.showMenu(tile);
|
||||
});
|
||||
if (!this.g.inSpawnPhase()) {
|
||||
this.activateMenuElement(Slot.Build, "#ebe250", buildIcon, () => {
|
||||
this.buildMenu.showMenu(tile);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.g.hasOwner(tile)) {
|
||||
this.activateMenuElement(Slot.Info, "#64748B", infoIcon, () => {
|
||||
this.playerPanel.show(actions, tile);
|
||||
|
||||
Reference in New Issue
Block a user