mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-06 04:54:10 +00:00
can capture and destroy ports
This commit is contained in:
@@ -72,6 +72,12 @@ export class StructureLayer implements Layer {
|
||||
private handlePortEvent(event: UnitEvent) {
|
||||
if (!this.anchorImageLoaded) return;
|
||||
|
||||
bfs(event.unit.tile(), euclDist(event.unit.tile(), 8))
|
||||
.forEach(t => this.clearCell(t.cell()));
|
||||
|
||||
if (!event.unit.isActive()) {
|
||||
return
|
||||
}
|
||||
// Create a temporary canvas to process the anchor icon
|
||||
const tempCanvas = document.createElement('canvas');
|
||||
const tempContext = tempCanvas.getContext('2d');
|
||||
|
||||
Reference in New Issue
Block a user