diff --git a/TODO.txt b/TODO.txt index a459bba7a..7b411b5a7 100644 --- a/TODO.txt +++ b/TODO.txt @@ -202,6 +202,8 @@ * add info view on top right DONE 11/30/2024 * add info view for units DONE 11/30/2024 * add defense post +* bugfix: destroyers can't find path to dest and freeze +* bugfix: when trade ships captured don't render * use mini A* for all pathfinding * record single player game stats * add radiation from nuke diff --git a/src/client/graphics/layers/TerritoryLayer.ts b/src/client/graphics/layers/TerritoryLayer.ts index 6dbe4128c..1b5a7f229 100644 --- a/src/client/graphics/layers/TerritoryLayer.ts +++ b/src/client/graphics/layers/TerritoryLayer.ts @@ -120,7 +120,14 @@ export class TerritoryLayer implements Layer { unitEvent(event: UnitEvent) { if (event.unit.type() == UnitType.DefensePost) { - bfs(event.unit.tile(), dist(event.unit.tile(), this.game.config().defensePostRange())).forEach(t => this.enqueue(t)) + bfs( + event.unit.tile(), + dist(event.unit.tile(), this.game.config().defensePostRange()) + ).forEach(t => { + if (t.isBorder()) { + this.enqueue(t) + } + }) } } diff --git a/src/core/game/GameImpl.ts b/src/core/game/GameImpl.ts index fd80ca762..19ac3e822 100644 --- a/src/core/game/GameImpl.ts +++ b/src/core/game/GameImpl.ts @@ -68,14 +68,14 @@ export class GameImpl implements MutableGame { addTileDefenseBonus(tile: Tile, unit: Unit, amount: number): DefenseBonus { const df = { unit: unit, tile: tile, amount: amount }; (tile as TileImpl)._defenseBonuses.push(df) - this.eventBus.emit(new TileEvent(tile)) + // this.eventBus.emit(new TileEvent(tile)) return df } removeTileDefenseBonus(bonus: DefenseBonus): void { const t = bonus.tile as TileImpl t._defenseBonuses = t._defenseBonuses.filter(db => db != bonus) - this.eventBus.emit(new TileEvent(bonus.tile)) + // this.eventBus.emit(new TileEvent(bonus.tile)) } units(...types: UnitType[]): UnitImpl[] {