From babb9baa2b3ee2e2cd9f2994a9ef7c50e38f0bb2 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Mon, 30 Sep 2013 11:22:15 +0200 Subject: [PATCH] Handle joining disbanded parties properly --- src/main/java/com/gmail/nossr50/party/PartyManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index 713345d1a..ebb6b885d 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -315,10 +315,11 @@ public final class PartyManager { public static void joinInvitedParty(McMMOPlayer mcMMOPlayer) { Party invite = mcMMOPlayer.getPartyInvite(); -// // Pretty sure this isn't possible -// if (!parties.contains(invite)) { -// parties.add(invite); -// } + // Check if the party still exists, it might have been disbanded + if (!parties.contains(invite)) { + mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Party.Disband")); + return; + } mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Invite.Accepted", invite.getName())); mcMMOPlayer.removePartyInvite();