Skip to content

Commit

Permalink
Merge pull request #34 from bearU369/bugfix/harvest
Browse files Browse the repository at this point in the history
Bugfix to #30
  • Loading branch information
Retera authored Apr 15, 2023
2 parents e141a69 + f218cee commit 7804df3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ protected void innerCheckCanTarget(final CSimulation game, final CUnit unit, fin
final CUnit targetUnit = (CUnit) target;
for (final CAbility ability : targetUnit.getAbilities()) {
if (ability instanceof CAbilityGoldMinable) {
if(this.goldCapacity <= 0){
receiver.mustTargetResources();
return;
}
receiver.targetOk(target);
return;
}
Expand All @@ -140,6 +144,10 @@ else if ((this.carriedResourceType != null) && (ability instanceof CAbilityRetur
}
else if (target instanceof CDestructable) {
if (target.canBeTargetedBy(game, unit, this.treeAttack.getTargetsAllowed())) {
if(this.lumberCapacity <= 0){
receiver.mustTargetResources();
return;
}
receiver.targetOk(target);
}
else {
Expand Down

0 comments on commit 7804df3

Please sign in to comment.