Remove redundant messaging. Fixes #276

When informing faction members, if the command sender is part of the
faction, do not send another message to him because he has already been
informed.
This commit is contained in:
Nick Porillo 2015-02-19 10:49:38 -05:00 committed by drtshock
parent 1d00a0aa54
commit 0aea7c6b9d

View File

@ -38,10 +38,14 @@ public class CmdPermanentPower extends FCommand {
change = TL.COMMAND_PERMANENTPOWER_GRANT.toString(); change = TL.COMMAND_PERMANENTPOWER_GRANT.toString();
} }
// Inform sender
msg(TL.COMMAND_PERMANENTPOWER_SUCCESS, change, targetFaction.describeTo(fme)); msg(TL.COMMAND_PERMANENTPOWER_SUCCESS, change, targetFaction.describeTo(fme));
// Inform all players // Inform all other players
for (FPlayer fplayer : targetFaction.getFPlayersWhereOnline(true)) { for (FPlayer fplayer : targetFaction.getFPlayersWhereOnline(true)) {
if(fplayer == fme) {
continue;
}
String blame = (fme == null ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(fplayer, true)); String blame = (fme == null ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(fplayer, true));
fplayer.msg(TL.COMMAND_PERMANENTPOWER_FACTION, blame, change); fplayer.msg(TL.COMMAND_PERMANENTPOWER_FACTION, blame, change);
} }