mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:40:18 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user