Fix mirvhead spamming same location (#801)

## Description:
There is a bug in the proximity check in the mirvhead destination 

This fixes it.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Vivacious Box
This commit is contained in:
Vivacious Box
2025-05-18 17:03:04 +02:00
committed by GitHub
parent 01ef525e11
commit 332629de78
+11 -4
View File
@@ -169,10 +169,8 @@ export class MirvExecution implements Execution {
if (this.mg.owner(tile) !== this.targetPlayer) {
continue;
}
for (const t of taken) {
if (this.mg.manhattanDist(tile, t) < 25) {
continue;
}
if (this.proximityCheck(tile, taken)) {
continue;
}
return tile;
}
@@ -180,6 +178,15 @@ export class MirvExecution implements Execution {
return null;
}
private proximityCheck(tile: TileRef, taken: TileRef[]): boolean {
for (const t of taken) {
if (this.mg.manhattanDist(tile, t) < 25) {
return true;
}
}
return false;
}
owner(): Player {
return this.player;
}