This commit is contained in:
Scott Anderson
2025-04-14 17:58:38 -04:00
parent b38e6a845d
commit 5e9819a973
20 changed files with 161 additions and 145 deletions
+3 -4
View File
@@ -295,10 +295,9 @@ export class BuildMenu extends LitElement implements Layer {
if (this.game?.myPlayer() === null || this.playerActions === null) {
return false;
}
const unit = this.playerActions.buildableUnits.filter(
(u) => u.type === item.unitType,
);
if (!unit) {
const buildableUnits = this.playerActions?.buildableUnits ?? [];
const unit = buildableUnits.filter((u) => u.type === item.unitType);
if (unit.length === 0) {
return false;
}
return unit[0].canBuild;
+2 -2
View File
@@ -230,7 +230,7 @@ export class WinModal extends LitElement implements Layer {
this.eventBus.emit(
new SendWinnerEvent(wu.winner as Team, wu.allPlayersStats, "team"),
);
if (wu.winner == this.game.myPlayer()?.team()) {
if (wu.winner === this.game.myPlayer()?.team()) {
this._title = "Your team won!";
this.won = true;
} else {
@@ -248,7 +248,7 @@ export class WinModal extends LitElement implements Layer {
new SendWinnerEvent(winnerClient, wu.allPlayersStats, "player"),
);
}
if (winner == this.game.myPlayer()) {
if (winner === this.game.myPlayer()) {
this._title = "You Won!";
this.won = true;
} else {