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:
evan
2025-04-24 12:40:51 -07:00
parent 7a944e670a
commit ff535820c5
2 changed files with 9 additions and 4 deletions
+3 -1
View File
@@ -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;
+6 -3
View File
@@ -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);