Bugfixes
This commit is contained in:
@@ -114,12 +114,16 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
||||
if(tile == null) return false;
|
||||
|
||||
if(tile.collide(this) && type.collides(this, tile) && !tile.dead() && (type.collidesTeam || tile.team() != team())){
|
||||
boolean remove = false;
|
||||
|
||||
if(tile.team() != team()){
|
||||
tile.collision(this);
|
||||
remove = tile.collision(this);
|
||||
}
|
||||
|
||||
type.hitTile(this, tile);
|
||||
remove();
|
||||
if(remove){
|
||||
type.hitTile(this, tile);
|
||||
remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1046,8 +1046,12 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
||||
return true;
|
||||
}
|
||||
|
||||
public void collision(Bulletc other){
|
||||
/** Handle a bullet collision.
|
||||
* @return whether the bullet should be removed. */
|
||||
public boolean collision(Bulletc other){
|
||||
damage(other.damage() * other.type().tileDamageMultiplier);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeFromProximity(){
|
||||
|
||||
@@ -37,7 +37,6 @@ public class AIController implements UnitController{
|
||||
}
|
||||
|
||||
protected void targetClosest(){
|
||||
//TODO optimize!
|
||||
Teamc newTarget = Units.closestTarget(unit.team(), unit.x(), unit.y(), Math.max(unit.range(), unit.type().range), u -> (unit.type().targetAir && u.isFlying()) || (unit.type().targetGround && !u.isFlying()));
|
||||
if(newTarget != null){
|
||||
target = newTarget;
|
||||
|
||||
@@ -2,7 +2,6 @@ package mindustry.entities.units;
|
||||
|
||||
import mindustry.gen.*;
|
||||
|
||||
//TODO rename
|
||||
public interface UnitController{
|
||||
void unit(Unitc unit);
|
||||
Unitc unit();
|
||||
|
||||
Reference in New Issue
Block a user