mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 14:04:14 +00:00
encirclement bug: ensure player is inscribed before losing territory
This commit is contained in:
@@ -149,7 +149,13 @@ export class PlayerExecution implements Execution {
|
||||
if (enemies.size != 1) {
|
||||
return false;
|
||||
}
|
||||
return this.mg.playerBySmallID(Array.from(enemies)[0]) as Player;
|
||||
const enemy = this.mg.playerBySmallID(Array.from(enemies)[0]) as Player;
|
||||
const enemyBox = calculateBoundingBox(this.mg, enemy.borderTiles());
|
||||
const clusterBox = calculateBoundingBox(this.mg, cluster);
|
||||
if (inscribed(enemyBox, clusterBox)) {
|
||||
return enemy;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private isSurrounded(cluster: Set<TileRef>): boolean {
|
||||
|
||||
Reference in New Issue
Block a user