diff --git a/src/ei/game/scene/units/Unit.java b/src/ei/game/scene/units/Unit.java index 66b82bf..a4adc93 100644 --- a/src/ei/game/scene/units/Unit.java +++ b/src/ei/game/scene/units/Unit.java @@ -232,7 +232,8 @@ public abstract class Unit extends GameEntity{ } else if(attack != null){ Weapon wepon = getWeapon(new Vector2f(unitNode.getLocation().getX(), unitNode.getLocation().getY())); - Vector2i enamyPos = Map.getPosByPixel(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY()); + Vector2i enamyPos = Map.getPosByPixel(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY()+1); + if(wepon.onRange(new Vector2f(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY()))){ if(weponTimer >= wepon.getReload()){ wepon.launch(enamyPos);