Skip to content

Commit 8476ce4

Browse files
author
Jasper Geurtz
committed
Fix more unit vs targetUnit bugs
1 parent 8665f78 commit 8476ce4

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
@@ -3911,7 +3911,7 @@ public boolean canAttackUnitGrouped(Unit targetUnit, boolean checkCanTargetUnit,
39113911
return false;
39123912
}
39133913

3914-
if (isInvincible()) {
3914+
if (targetUnit.isInvincible()) {
39153915
return false;
39163916
}
39173917

@@ -4722,9 +4722,7 @@ public boolean canGather(Unit targetUnit, boolean checkCanTargetUnit, boolean ch
47224722
if (!hasPath(targetUnit.getPosition())) {
47234723
return false;
47244724
}
4725-
4726-
return !uType.isRefinery() || getPlayer().equals(game.self());
4727-
4725+
return !targetUnit.getType().isRefinery() || targetUnit.getPlayer().equals(game.self());
47284726
}
47294727

47304728
public boolean canReturnCargo() {

0 commit comments

Comments
 (0)