mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 11:54:43 +00:00
keep
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user