Don't send spy messages to spyers who are the ones sending the message.

This commit is contained in:
drtshock 2015-05-19 15:57:02 -05:00
parent 679063d892
commit 2ad527b85b

View File

@ -42,7 +42,7 @@ public class FactionsChatListener implements Listener {
//Send to any players who are spying chat //Send to any players who are spying chat
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
if (fplayer.isSpyingChat() && fplayer.getFaction() != myFaction) { if (fplayer.isSpyingChat() && fplayer.getFaction() != myFaction && me != fplayer) {
fplayer.sendMessage("[FCspy] " + myFaction.getTag() + ": " + message); fplayer.sendMessage("[FCspy] " + myFaction.getTag() + ": " + message);
} }
} }
@ -60,10 +60,7 @@ public class FactionsChatListener implements Listener {
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
if (myFaction.getRelationTo(fplayer) == Relation.ALLY && !fplayer.isIgnoreAllianceChat()) { if (myFaction.getRelationTo(fplayer) == Relation.ALLY && !fplayer.isIgnoreAllianceChat()) {
fplayer.sendMessage(message); fplayer.sendMessage(message);
} } else if (fplayer.isSpyingChat() && me != fplayer) {
//Send to any players who are spying chat
else if (fplayer.isSpyingChat()) {
fplayer.sendMessage("[ACspy]: " + message); fplayer.sendMessage("[ACspy]: " + message);
} }
} }
@ -83,10 +80,7 @@ public class FactionsChatListener implements Listener {
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
if (myFaction.getRelationTo(fplayer) == Relation.TRUCE) { if (myFaction.getRelationTo(fplayer) == Relation.TRUCE) {
fplayer.sendMessage(message); fplayer.sendMessage(message);
} } else if (fplayer.isSpyingChat() && fplayer != me) {
//Send to any players who are spying chat
else if (fplayer.isSpyingChat()) {
fplayer.sendMessage("[TCspy]: " + message); fplayer.sendMessage("[TCspy]: " + message);
} }
} }