mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-25 22:17:59 +07:00
Team#isEnemy is pointless
This commit is contained in:
parent
dc63112915
commit
564e81e734
Binary file not shown.
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 523 B |
@ -600,7 +600,7 @@ public class Damage{
|
||||
for(int dx = -trad; dx <= trad; dx++){
|
||||
for(int dy = -trad; dy <= trad; dy++){
|
||||
Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy);
|
||||
if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad*trad){
|
||||
if(tile != null && tile.build != null && (team == null || team != tile.team()) && dx*dx + dy*dy <= trad*trad){
|
||||
tile.build.damage(team, damage);
|
||||
}
|
||||
}
|
||||
|
@ -121,6 +121,8 @@ public class Team implements Comparable<Team>{
|
||||
return isAI() && !rules().rtsAi;
|
||||
}
|
||||
|
||||
/** @deprecated There is absolutely no reason to use this. */
|
||||
@Deprecated
|
||||
public boolean isEnemy(Team other){
|
||||
return this != other;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
}else{
|
||||
Building tile = world.buildWorld(x, y);
|
||||
|
||||
if((tile != null && player.team().isEnemy(tile.team) && (tile.team != Team.derelict || state.rules.coreCapture)) || (tile != null && player.unit().type.canHeal && tile.team == player.team() && tile.damaged())){
|
||||
if((tile != null && player.team() != tile.team && (tile.team != Team.derelict || state.rules.coreCapture)) || (tile != null && player.unit().type.canHeal && tile.team == player.team() && tile.damaged())){
|
||||
player.unit().mineTile = null;
|
||||
target = tile;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user