1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-10-06 21:07:25 +03:00

Homing bullet targeting fix

This commit is contained in:
Anuken 2022-06-23 17:00:24 -04:00
parent e682a0f1d3
commit d4a33c6d51

View File

@ -522,7 +522,11 @@ public class BulletType extends Content implements Cloneable{
t -> collidesGround && (t.team != b.team || t.damaged()) && !b.hasCollided(t.id)
);
}else{
target = Units.closestTarget(b.team, realAimX, realAimY, homingRange, e -> e.checkTarget(collidesAir, collidesGround) && !b.hasCollided(e.id), t -> collidesGround && !b.hasCollided(t.id));
if(b.aimTile != null && b.aimTile.build != null && b.aimTile.build.team != b.team && collidesGround && !b.hasCollided(b.aimTile.build.id)){
target = b.aimTile.build;
}else{
target = Units.closestTarget(b.team, realAimX, realAimY, homingRange, e -> e.checkTarget(collidesAir, collidesGround) && !b.hasCollided(e.id), t -> collidesGround && !b.hasCollided(t.id));
}
}
if(target != null){