From da1fb45ea05a840a4522b07a7399e6fa3f6c5009 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 20 Jan 2012 11:19:35 -0600 Subject: [PATCH] Fix for error when deleting a faction if Vault wasn't present; Fix for slashless Factions commands not working for player in faction chat or alliance chat modes --- src/com/massivecraft/factions/Faction.java | 2 -- .../listeners/FactionsChatEarlyListener.java | 15 +++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index 025745e3..8806ef94 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -701,8 +701,6 @@ public class Faction extends Entity implements EconomyParticipator Econ.setBalance(getAccountId(), 0); } - this.getAccountId(); - // Clean the board Board.clean(); diff --git a/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java b/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java index 794e2b24..f5c66b84 100644 --- a/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsChatEarlyListener.java @@ -34,9 +34,17 @@ public class FactionsChatEarlyListener extends PlayerListener String msg = event.getMessage(); FPlayer me = FPlayers.i.get(talkingPlayer); - + ChatMode chat = me.getChatMode(); + + // slashless factions commands need to be handled here if the user isn't in public chat mode + if (chat != ChatMode.PUBLIC && p.handleCommand(event.getPlayer(), event.getMessage())) + { + event.setCancelled(true); + return; + } + // Is it a faction chat message? - if (me.getChatMode() == ChatMode.FACTION) + if (chat == ChatMode.FACTION) { Faction myFaction = me.getFaction(); @@ -54,9 +62,8 @@ public class FactionsChatEarlyListener extends PlayerListener event.setCancelled(true); return; - } - else if (me.getChatMode() == ChatMode.ALLIANCE ) + else if (chat == ChatMode.ALLIANCE) { Faction myFaction = me.getFaction();