Skip to content

Commit

Permalink
Bounces should target live units only
Browse files Browse the repository at this point in the history
  • Loading branch information
Bytekeeper committed Oct 20, 2019
1 parent 55d9c8b commit faf1e2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/bk/ass/sim/AgentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static void dealBounceDamage(
for (int i = enemies.size() - 1; i >= 0 && remainingBounces > 0; i--) {
Agent enemy = enemies.get(i);
if (enemy != lastTarget
&& enemy.healthShifted > 0
&& abs(enemy.x - lastTarget.x) <= 96
&& abs(enemy.y - lastTarget.y) <= 96) {
lastTarget = enemy;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/bk/ass/sim/RetreatBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static boolean simFlee(int frames, Agent agent, UnorderedCollection<Agent> enemi
for (int i = enemies.size() - 1; i >= 0; i--) {
Agent enemy = enemies.get(i);
Weapon wpn = enemy.weaponVs(agent);
// Enemy could be dead already, but skipping it generally doesn't make a difference and it will be gone next frame.
if (wpn.damageShifted != 0) {
int distanceSq = distanceSquared(agent, enemy);
if (distanceSq >= wpn.minRangeSquared && distanceSq < selectedDistanceSquared) {
Expand Down

0 comments on commit faf1e2b

Please sign in to comment.