Skip to content

Commit 1848d3c

Browse files
author
M0diis
committed
Fix merge issues.
1 parent 87f31f2 commit 1848d3c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugin/src/main/java/at/helpch/chatchat/util/ChannelUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static boolean isTargetWithinRadius(
5454
}
5555

5656
if (radius != -1 && source instanceof ChatUser) {
57-
final Location targetLocation = targetChatUser.player().getLocation();
57+
final Location sourceLocation = targetChatUser.player().getLocation();
5858
final Location targetLocation = ((ChatUser) target).player().getLocation();
5959

6060
final World sourceWorld = sourceLocation.getWorld();
@@ -64,6 +64,9 @@ public static boolean isTargetWithinRadius(
6464
return false;
6565
}
6666

67+
final int relativeX = targetLocation.getBlockX() - sourceLocation.getBlockX();
68+
final int relativeZ = targetLocation.getBlockZ() - sourceLocation.getBlockZ();
69+
6770
return relativeX*relativeX + relativeZ*relativeZ <= radius*radius;
6871
}
6972

0 commit comments

Comments
 (0)