From 1196d74140ec4ac950da7a28849a73bffc7e8568 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 20 Jan 2012 11:19:34 -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 6980afcb..2ac359b6 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -539,8 +539,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 a98f304b..6a1f113f 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();