1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-05 06:07:54 +02:00

Fix chat showing [spy] prefix when social spy was not required to see the message.

Fixes #2263
This commit is contained in:
KHobbits
2012-06-16 16:05:48 +01:00
parent 5da886593b
commit a764f8c929

View File

@@ -127,23 +127,26 @@ public abstract class EssentialsChatPlayer implements Listener
} }
if (!onlineUser.equals(sender)) if (!onlineUser.equals(sender))
{ {
boolean abort = false;
final Location playerLoc = onlineUser.getLocation();
if (playerLoc.getWorld() != world)
{
abort = true;
}
final double delta = playerLoc.distanceSquared(loc);
if (delta > chatStore.getRadius())
{
abort = true;
}
if (abort) {
if (onlineUser.isAuthorized("essentials.chat.spy")) if (onlineUser.isAuthorized("essentials.chat.spy"))
{ {
type = type.concat(_("chatTypeSpy")); type = type.concat(_("chatTypeSpy"));
} }
else else
{
final Location playerLoc = onlineUser.getLocation();
if (playerLoc.getWorld() != world)
{ {
continue; continue;
} }
final double delta = playerLoc.distanceSquared(loc);
if (delta > chatStore.getRadius())
{
continue;
}
}
} }
String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage()); String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage());