Comment updates

This commit is contained in:
variablevince
2025-10-24 04:00:21 +02:00
parent 92d2b45340
commit e90cfc3fb9
3 changed files with 4 additions and 7 deletions
-3
View File
@@ -419,9 +419,7 @@ export class ClientGameRunner {
this.myPlayer = myPlayer;
}
this.myPlayer.actions(tile, TransportShipFilter.Only).then((actions) => {
// if (this.myPlayer === null) return; //--> redundant check as set above?, but need to add ! below to stop error 'can be null'
if (actions.canAttack) {
//-->maybe only get actions.canAttack + transportship from buildableunits? Not everything else?
this.eventBus.emit(
new SendAttackIntentEvent(
this.gameView.owner(tile).id(),
@@ -517,7 +515,6 @@ export class ClientGameRunner {
}
this.myPlayer.actions(tile, TransportShipFilter.Only).then((actions) => {
//-->> maybe only get transportship from buildableunits? Not everything else?
if (this.canBoatAttack(actions) !== false) {
this.sendBoatAttackIntent(tile);
}
@@ -103,7 +103,6 @@ export class UnitDisplay extends LitElement implements Layer {
tick() {
const player = this.game?.myPlayer();
player?.actions(undefined, TransportShipFilter.Exclude).then((actions) => {
// player?.actions(undefined, TransportShipFilter.Default).then((actions) => {
this.playerActions = actions;
});
if (!player) return;
+4 -3
View File
@@ -861,8 +861,9 @@ export interface NameViewData {
size: number;
}
// Filter for buildableUnits
export enum TransportShipFilter {
Default = "default", // Include TransportShip with all units
Exclude = "exclude", // Skip TransportShip in the unit list
Only = "only", // Only check TransportShip
Default = "default", // Include
Exclude = "exclude", // Exclude
Only = "only", // TransportShip only
}