Homing on healing bullets does not take collided into account (#6276)

This commit is contained in:
Matthew Peng 2021-10-31 10:03:19 -07:00 committed by GitHub
parent 24810ddbf5
commit 4999c25723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,8 +359,9 @@ public class BulletType extends Content implements Cloneable{
//home in on allies if possible
if(healPercent > 0){
target = Units.closestTarget(null, b.x, b.y, homingRange,
e -> e.checkTarget(collidesAir, collidesGround) && e.team != b.team,
t -> collidesGround && (t.team != b.team || t.damaged()));
e -> e.checkTarget(collidesAir, collidesGround) && e.team != b.team && !b.hasCollided(e.id),
t -> collidesGround && (t.team != b.team || t.damaged()) && !b.hasCollided(t.id)
);
}else{
target = Units.closestTarget(b.team, b.x, b.y, homingRange, e -> e.checkTarget(collidesAir, collidesGround) && !b.hasCollided(e.id), t -> collidesGround && !b.hasCollided(t.id));
}