Skip to content

Commit 687dc8a

Browse files
author
Jasper Geurtz
committed
Fix more unit vs targetUnit bugs
1 parent b50dc42 commit 687dc8a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/main/java/bwapi/Unit.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3877,7 +3877,7 @@ public boolean canAttackUnitGrouped(Unit targetUnit, boolean checkCanTargetUnit,
38773877
return false;
38783878
}
38793879

3880-
if (isInvincible()) {
3880+
if (targetUnit.isInvincible()) {
38813881
return false;
38823882
}
38833883

@@ -4688,9 +4688,7 @@ public boolean canGather(Unit targetUnit, boolean checkCanTargetUnit, boolean ch
46884688
if (!hasPath(targetUnit.getPosition())) {
46894689
return false;
46904690
}
4691-
4692-
return !uType.isRefinery() || getPlayer().equals(game.self());
4693-
4691+
return !targetUnit.getType().isRefinery() || targetUnit.getPlayer().equals(game.self());
46944692
}
46954693

46964694
public boolean canReturnCargo() {

0 commit comments

Comments
 (0)