Building target discovered check

This commit is contained in:
Anuken
2022-10-22 11:06:08 -04:00
parent b2d27c70e6
commit 43b4dc321c
4 changed files with 19 additions and 2 deletions

View File

@@ -356,7 +356,7 @@ public class BlockIndexer{
if(enemy == team || (enemy == Team.derelict && !state.rules.coreCapture)) continue;
Building candidate = indexer.findTile(enemy, x, y, range, pred, true);
if(candidate == null) continue;
if(candidate == null || !candidate.isDiscovered(team)) continue;
//if a block has the same priority, the closer one should be targeted
float dist = candidate.dst(x, y) - candidate.hitSize() / 2f;