This commit is contained in:
Anuken
2021-11-02 09:04:37 -04:00
parent c4dc7e91f3
commit 99d30b6351
2 changed files with 3 additions and 2 deletions

View File

@@ -461,11 +461,12 @@ public class Damage{
}
private static void completeDamage(Team team, float x, float y, float radius, float damage){
int trad = (int)(radius / tilesize);
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){
if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad*trad){
tile.build.damage(team, damage);
}
}