From b97f662d70c93bb0e4cbcfd727984a2187aa0f1c Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 25 Feb 2020 11:02:01 +0100 Subject: [PATCH] BasicTower has a radius of 3 blocks --- src/main/java/fr/ynerant/leveleditor/game/BasicTower.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/ynerant/leveleditor/game/BasicTower.java b/src/main/java/fr/ynerant/leveleditor/game/BasicTower.java index 0f377f9..486d6d6 100644 --- a/src/main/java/fr/ynerant/leveleditor/game/BasicTower.java +++ b/src/main/java/fr/ynerant/leveleditor/game/BasicTower.java @@ -34,7 +34,8 @@ public class BasicTower extends Tower { List filtered = new ArrayList<>(); for (Mob mob : mobs) { - if (mob.getX() == getX() || mob.getY() == getY()) + if ((mob.getX() == getX() || mob.getY() == getY()) + && Math.abs(mob.getX() - getX()) <= 3 && Math.abs(mob.getY() - getY()) <= 3) filtered.add(mob); }